Dependency conflict error in my Android app which has Android Tests

后端 未结 5 2058
[愿得一人]
[愿得一人] 2020-12-08 13:46

I\'m using AndroidStudio and Gradle to build my Android app with tests in the \'androidTest\' source directory. I added a new dependency and am now getting the following iss

5条回答
  •  轮回少年
    2020-12-08 14:05

    Had similar problem. First - I upgrade the gradle plugin to 1.1.1 (in the project's gradle):

    classpath 'com.android.tools.build:gradle:1.1.1'
    

    which helped me realize that the problem was the app referring to:

    com.android.support:support-annotations:21.0.3
    

    while the test app was referring to:

    com.android.support:support-annotations:20.0.0  
    

    (due to specifying androidTestCompile 'com.squareup.assertj:assertj-android-appcompat-v7:1.0.0')

    solved it by specifying:

    androidTestCompile 'com.android.support:support-annotations:21.0.3'
    

提交回复
热议问题