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

前端 未结 30 2150
忘掉有多难
忘掉有多难 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:43

    You have defined any other dependency to compile with version 24.0.0 instead of 25.1.1. Please set all dependencies version the same as 25.1.1.

    0 讨论(0)
  • 2020-11-21 05:45

    Use support-v13 instead of support-v4

    compile 'com.android.support:support-v13:25.2.0'
    
    0 讨论(0)
  • 2020-11-21 05:47

    The best way to solve the problem is implement all 'com.android.support:...' suggested by Android Studio

    (Doesn't matter which support versions you are using – 27.1.1, 28.0.0 etc.)

    Place the cursor to the error line e.g.

    implementation 'com.android.support:appcompat-v7:28.0.0'
    

    Android Studio will suggest you which 'com.android.support:...' is different version than 'com.android.support:appcompat-v7:28.0.0'

    Example

    All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 27.1.0, 27.0.2. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:exifinterface:27.1.0

    So add com.android.support:animated-vector-drawable:28.0.0 & com.android.support:exifinterface:28.0.0. Now sync gradle file.

    One by one try to implement all the suggested 'com.android.support:...' until there is no error in this line implementation 'com.android.support:appcompat-v7:28.0.0'

    In my case, I added

    implementation 'com.android.support:appcompat-v7:28.0.0'
    
    implementation 'com.android.support:animated-vector-drawable:28.0.0'
    implementation 'com.android.support:exifinterface:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:customtabs:28.0.0'
    implementation 'com.android.support:support-media-compat:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    

    All these dependencies, it could be different for you.

    0 讨论(0)
  • 2020-11-21 05:48

    Very Simple with the new version of the android studio 3.x.

    Just copy the version that is less than the current version and add it explicitly with same version number as current version.

    Example

    Found versions 27.1.1, 27.1.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:exifinterface:27.1.0

    Just copy the version com.android.support:exifinterface:27.1.0 and change it to com.android.support:exifinterface:27.1.1 so that it becomes equal to the current version you are using and add it to your gradle dependencies as following.

    implementation 'com.android.support:exifinterface:27.1.1'
    

    Note: Once you are done don't forget to click Sync now at the top of the editor.

    0 讨论(0)
  • 2020-11-21 05:49

    After searching and combining answers, 2018 version of this question and it worked for me:

    1) On navigation tab change it to project view

    2) Navigate to [YourProjectName]/.idea/libraries/

    3) Delete all files starting with Gradle__com_android_support_[libraryName]

    E.g: Gradle__com_android_support_animated_vector_drawable_26_0_0.xml

    4) In your gradle file define a variable and use it to replace version number like ${variableName}

    Def variable:

    ext {
        support_library_version = '28.0.0' //use the version of choice
    }
    

    Use variable:

    implementation "com.android.support:cardview-v7:${support_library_version}"
    

    example gradle:

    dependencies {
        ext {
            support_library_version = '28.0.0' //use the version of choice
        }
    
        implementation fileTree(include: ['*.jar'], dir: 'libs')
    
        implementation "com.android.support:animated-vector-drawable:${support_library_version}"
        implementation "com.android.support:appcompat-v7:${support_library_version}"
        implementation "com.android.support:customtabs:${support_library_version}"
        implementation "com.android.support:cardview-v7:${support_library_version}"
        implementation "com.android.support:support-compat:${support_library_version}"
        implementation "com.android.support:support-v4:${support_library_version}"
        implementation "com.android.support:support-core-utils:${support_library_version}"
        implementation "com.android.support:support-core-ui:${support_library_version}"
        implementation "com.android.support:support-fragment:${support_library_version}"
        implementation "com.android.support:support-media-compat:${support_library_version}"
        implementation "com.android.support:appcompat-v7:${support_library_version}"
        implementation "com.android.support:recyclerview-v7:${support_library_version}"
        implementation "com.android.support:design:${support_library_version}"
    
    }
    
    0 讨论(0)
  • 2020-11-21 05:49

    I just update my Android Support Repository to (revision: 44.0.0); then Android SDK tools and Emulator to latest version 25.3.1 from sdk manager> SDK tools And it solved my problem.

    0 讨论(0)
提交回复
热议问题