John Kelvin Atienza
John Kelvin Atienza

Reputation: 47

“All com.android.support libraries must use the exact same version specification” in android studio

I use the current version of mapbox SDK navigation. Navigation SDK for Android Current version: v0.32.0 and I got a error if I add the implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.30.0' in the build.gradle (Module:app)

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. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:exifinterface:27.1.0

Gradle:

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    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'

    //Mapbox Dependencies
    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:7.2.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.11.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.32.0'}

Upvotes: 1

Views: 164

Answers (1)

ror
ror

Reputation: 3500

These kind of issues are debugged by executing ./gradlew app:dependencies (app is a module name, yours can be different) and reviewing dependency tree for dependencies that bring different compat versions with them.

In your case, apparently the dependency already known (com.mapbox.mapboxsdk:mapbox-android-navigation-ui) thus you can try to resolve it like this:

implementation ('com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.32.0') {
    exclude module: 'exifinterface'
}

Upvotes: 1

Related Questions