How to resolve gradle conflicts in android studio?

我是研究僧i 提交于 2019-12-20 02:58:15

问题


Please find my gradle file below.

As you can see its showing inn red.and if i place cursor there I get the hint as 'All com.android.support libraries must use the exact same version specification.Found '

'com.android.support:animated-vector-drawable:27.1.0

and

'com.android.support:design:26.1.0 '

So i followed the hint and explicitly added

com.android.support:animated-vector-drawable:26.1.0

' ,with the correct version ,as you can see in the image.Still its showing error.

Please help.


回答1:


This happened sometimes when we use external libraries from Github and I have faced it many times. I can notice you are using some external libraries in project. These libraries might using version 27.1.0 and you are using 26.1.0. Solution to this problem is either remove those libraries or change your version from 26.1.0 to 27.1.0

and If you trying latest version, don't forgot to do following:

allprojects {
    repositories {
        google()

        // If you're using a version of Gradle lower than 4.1, you must instead use:
        // maven {
        //     url 'https://maven.google.com'
        // }
        // An alternative URL is 'https://dl.google.com/dl/android/maven2/'
    }
}



回答2:


Support library should not use a different version than the comileSdkVersion



来源:https://stackoverflow.com/questions/49030498/how-to-resolve-gradle-conflicts-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!