All com.android.support libraries must use the exact same version specification

前端 未结 30 2142
忘掉有多难
忘掉有多难 2020-11-21 05:10

After updating to android studio 2.3 I got this error message. I know it\'s just a hint as the app run normally but it\'s really strange.

All com.andr

30条回答
  •  逝去的感伤
    2020-11-21 05:38

    I had this:

    dependencies {
       implementation fileTree(dir: 'libs', include: ['*.jar'])
       implementation 'com.android.support:appcompat-v7:27.1.1'
       implementation 'com.android.support:design:27.1.1'
       implementation 'com.android.support:support-v4:27.1.1'
       implementation 'com.google.firebase:firebase-auth:12.0.1'
       implementation 'com.google.firebase:firebase-firestore:12.0.1'
       implementation 'com.google.firebase:firebase-messaging:12.0.1'
       implementation 'com.google.android.gms:play-services-auth:12.0.1'
       implementation'com.facebook.android:facebook-login:[4,5)'
       implementation 'com.twitter.sdk.android:twitter:3.1.1'
       implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
       implementation 'org.jetbrains:annotations-java5:15.0'
       implementation project(':vehiclesapi')
       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'
    }
    

    and got this error:

    The solutions was easy - the primary dependencies were all correct so the leaves however - any third party dependencies. Removed one by one until found the culprit, and turns out to be facebook! its using version 27.0.2 of the android support libraries. I tried to add the cardview version 27.1.1 but that didn't work eithern the solution was still simple enough.

    dependencies {
       implementation fileTree(dir: 'libs', include: ['*.jar'])
       implementation 'com.android.support:appcompat-v7:27.1.1'
       implementation 'com.android.support:design:27.1.1'
       implementation 'com.android.support:support-v4:27.1.1'
       implementation 'com.google.firebase:firebase-auth:12.0.1'
       implementation 'com.google.firebase:firebase-firestore:12.0.1'
       implementation 'com.google.firebase:firebase-messaging:12.0.1'
       implementation 'com.google.android.gms:play-services-auth:12.0.1'
       implementation('com.facebook.android:facebook-login:[4,5)'){
           // contains com.android.support:v7:27.0.2, included required com.android.support.*:27.1.1 modules
        exclude group: 'com.android.support'
       }
       implementation 'com.android.support:cardview-v7:27.1.1' // to replace facebook sdk's cardview-v7:27.0.2.
       implementation 'com.twitter.sdk.android:twitter:3.1.1'
       implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
       implementation 'org.jetbrains:annotations-java5:15.0'
       implementation project(':vehiclesapi')
       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'
    }
    

提交回复
热议问题