Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (23.1.0) and test app (23.0.1) differ

后端 未结 9 1276
臣服心动
臣服心动 2020-11-28 21:38

When building I get the following error:

Conflict with dependency \'com.android.support:support-annotations\'. Resolved versions for app (23.1.0) and test a         


        
9条回答
  •  佛祖请我去吃肉
    2020-11-28 22:17

    I was getting the same error today:

    Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ.

    What I did:

    • I simply updated all my dependencies to 27.1.1 instead of 26.1.0
    • Also, updated my compileSdkVersion 27 and targetSdkVersion 27 which were 26 earlier

    And com.android.support:support-annotations error was gone!

    For Ref:

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support.constraint:constraint-layout:1.1.0'
        implementation 'com.android.support:design:27.1.1'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    }
    

提交回复
热议问题