1

I'm making an app in android studio and I need to add the Google Play Services dependecie in the gradle module. Now I've tried to add it manually like this:


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


I have also tried it through the module manager. Now which exact play-services-(ie.-analytics) do I need to add, so not the bundle (play-services) for using achievements?


And as soon as I add the Play Services the following error appears:


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


I don't get any better from the documentations.

Here is my gradle:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.bnf.xpclicker"
        minSdkVersion 24
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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.2'
    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-identity:15.0.1'***
}
Aydin
  • 23
  • 1
  • 9
  • See this doc https://developers.google.com/identity/sign-in/android/start-integrating this can help you. – Crammeur Aug 02 '18 at 18:45
  • Try to add this `apply plugin: 'com.google.gms.google-services'` at the end of gradle file. See the doc https://developers.google.com/android/guides/google-services-plugin – Crammeur Aug 02 '18 at 19:19
  • As an additional reference, you can refer to [this SO post](https://stackoverflow.com/questions/42374151/all-com-android-support-libraries-must-use-the-exact-same-version-specification) as it contains the scenarios and solution on how to resolve the error you have encountered. – MαπμQμαπkγVπ.0 Aug 03 '18 at 11:33

0 Answers0