1

enter image description here

According to the image I didn't add any dependencies related to the error showing and even after I added the dependency showing in the conflict error again giving me the same error as below.

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.2.

This is my build.gradle file dependencies (After adding the dependency showing in the image implementation 'com.android.support:customtabs:27.1.1').

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'android.arch.lifecycle:extensions:1.1.1'

implementation 'com.android.support:cardview-v7:27.1.1'

implementation 'com.google.firebase:firebase-database:15.0.1'

implementation 'com.google.firebase:firebase-analytics:15.0.1'

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

implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation "com.google.android.gms:play-services-location:15.0.1"

implementation 'com.google.android.gms:play-services-maps:15.0.1'

//fb sdk
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'


implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
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'

This question is different from the All com.android.support libraries must use the exact same version specification is that the app is building and working. But in my question the application building is failed due to the above noted error. And also there are no any version conflicts with the added dependencies.

Thisara
  • 179
  • 1
  • 13
  • 1
    Possible duplicate of [All com.android.support libraries must use the exact same version specification](https://stackoverflow.com/questions/42374151/all-com-android-support-libraries-must-use-the-exact-same-version-specification) – Martin Zeitler Sep 12 '18 at 12:39
  • Update your dependencies. When it says "Examples include" they're just examples. – TheWanderer Sep 12 '18 at 12:40
  • I didn't add any dependency related to the customtabs which showing in the error. So how it could be different in version? I added the this dependency after the issue with the versions. But even after adding that the same error showing. – Thisara Sep 12 '18 at 12:56
  • I have solved the issue through updating the gradle version of my application. Earlier I had gradle version 4.6 and updated to version 4.9. – Thisara Sep 16 '18 at 07:01

3 Answers3

2

Since you have all play services versions same.

Add apply plugin: 'com.google.gms.google-services' at bottom of your gradle. This will most probably solve your issue.

1

My guess is that libraries you DO declare in turn depend on other versions of some other library you also declare, leading to version conflicts.

the command gradle dependencies might be a good friend. Run that and you can see if you have different library dependency versions in your tree.

Good luck!

Mathias
  • 3,879
  • 5
  • 36
  • 48
1

open build.gradle and change targetSdkVersion and complieSdkVersion to 27

defaultConfig {
        applicationId "com.xxx.xxxxx"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 59
        versionName "7.5"
        compileSdkVersion 27
        buildToolsVersion "27.0.2"
        multiDexEnabled true
    }

remember you should have the support library for version 27 to make it work

Add this in your dependencies

buildscript {
repositories {
    jcenter()
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

Kevin Kurien
  • 812
  • 6
  • 14