Android support library error after updating to 23.3.0

后端 未结 13 788
南笙
南笙 2020-11-30 02:28

I have been using android support v4 23.1.1 and recently tried to update it to 23.3.0 ( the latest one when this was asked) but I got the following error:

13条回答
  •  误落风尘
    2020-11-30 02:39

    Just exemplifying Akshayraj's answer

    Original Gradle file:

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        [...]
    
        compile 'com.android.support:support-annotations:25.3.0'
        androidTestCompile 'com.android.support.test:runner:0.5'
        androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    
    }
    

    Received error:

    Error:Conflict with dependency 'com.android.support:support-annotations' in project ':app'.
    Resolved versions for app (25.1.0) and test app (23.1.1) differ.
    See http://g.co/androidstudio/app-test-app-conflict for details. "

    FIXED when I added:

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

    Final File:

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        [...]
    
        compile 'com.android.support:support-annotations:25.3.0'
    
        androidTestCompile 'com.android.support:support-annotations:25.3.0'
        androidTestCompile 'com.android.support.test:runner:0.5'
        androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    }
    

提交回复
热议问题