All com.android.support libraries should use the same version specification: 27.0.2

After upgrading targetSdkVersion to 27, I received this error message.

All com.android.support libraries must use the same version specification (mixing versions can cause runtime crashes). Found versions 27.0.2, 25.2.0. Examples include com.android.support:animated-vector-drawable:27.0.2andcom.android.support:support-media-compat:25.2.0

I understand that I need to update com.android.support:support-media-compat, but I do not know, because I do not use it in build.gradle, I tried to update the SDK tools, but the problem still remains. below: build.gradle:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.ex"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.google.android.gms:play-services-ads:11.6.2'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.github.bloder:magic:1.1'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    implementation 'com.android.support:cardview-v7:27.0.2'
}
+4
source share
6 answers

→ .myidea- > library, , , :

com_android_support_support_media_compat_25_2_0 com_android_support_support_v4_25_2_0

builde.gradle

'com.android.support:support-v4:27.0.2'

.

+4

. build.graddle, , build.graddle. , , build.graddle

+2

. Android Studio.

  • 2 " ".

, implementation com.android.support:support-media-compat:27.0.2

0

, , , . , , gradle, , , , . , "com.github.bloder: magic: 1.1", "com.android.support:appcompat-v7:23.1.1". , pom . Android gradle . , , , , . , . , .

0

gradle. . . . , 27.0.2 25.2.0 com.android.support. *.

-1

, , , .

./gradlew -q app: dependencies --configuration compile

, .

, , . . .

enter image description here

, 23.4.0 , gradle. , (23.4.0) . , gradle. , , .

you can clearly see that com.android.support:cardview-v7:23.4.0 and com.android.support:customtabs:23.4.0 are using which creates a problem. Now just just copy this line from the dependency list and use it explicitly in our gradle file, but with an updated version link

implementation of "com.android.support:cardview-v7:26.1.0" implementation of "com.android.support:customtabs:26.1.0"

Please refer to this to see the original answer fooobar.com/questions/25642 / ...

-1
source

Source: https://habr.com/ru/post/1690790/


All Articles