-1

Implementing Google sign in using firebase.

This is my project level build.gradle

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.0.0'

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

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

This is my App level build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "wallet.mycoin"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "0.2"
        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:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:26.1.0'
    compile 'com.google.code.gson:gson:2.8.2'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.okhttp:okhttp:2.4.0'
    compile 'com.squareup.okio:okio:1.5.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.google.android.gms:play-services-auth:11.8.0'
}

While building i am getting an error like >

Error:Execution failed for task ':app:processDebugGoogleServices'. 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 9.0.0.

<<

And

All firebase/gms libraries must use the exact same specification (mixing versions can lead to run time crashes) Found versions 9.0.0 and 11.8.0. Examples include com.google.firebase:firebase-analytics:9.0.0 and com.google.android.gms:play-services-auth:11.8.0.

There are some combinations of libraries , or tools and libraries that are incompatible, or can lead to bugs. One such incompatibility compiling with a version of Android support library that is not the latest version (or in a particular version lower than targetSdkVersion)

There is no firebase analytics library added in the project. Can anyone suggest a solution. Build failed.

Mandeep Kumar
  • 776
  • 4
  • 18
Arundas K V
  • 801
  • 2
  • 14
  • 28

1 Answers1

4
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.okio:okio:1.5.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'
}
apply plugin: 'com.google.gms.google-services'

Use this file , remember to add google-services configuration file .

Mandeep Kumar
  • 776
  • 4
  • 18
  • Nothing changed. I wonder i don't want the places and location dependency. What you mean by this. Also downgraded the gson to 2.6.2. – Arundas K V Dec 21 '17 at 06:55
  • you can remove location and places ,but remove apply plugin: 'com.google.gms.google-services' from top and append at the end of file . You can use the same gson , i have updated the answer – Mandeep Kumar Dec 21 '17 at 07:36
  • just put <> from top to bottom. all working well – Arundas K V Dec 21 '17 at 09:26