-1

i was trying to make google map program and it gives that error

../../build.gradle: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). 

Found versions 28.0.0, 26.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-media-compat:26.1.0

There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion). Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA. To suppress this error, use the issue id "GradleCompatible" as explained in the Suppressing Warnings and Errors section.

the versions

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'
    implementation'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'

}
ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
Amr Hassan
  • 31
  • 7

2 Answers2

0

You need to exclude com.android.support dependency from esspresso-core like below:

androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})

This will fix your issue.

Jeel Vankhede
  • 11,592
  • 2
  • 28
  • 58
0

If you don't use Unit and Local testing then just remove these testing libraries. Your gradle will look like.

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'
    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
}
Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212