-1

besides having the issue solved for my case (this would already be super swell) I'm also generally interested in how to debug this kind of stuff (it's not the first time I get into this kind of issue and tackling it is every time quite a hassle)

My question:

I'd like my users to be able to login with their google account in my android app and follow this guide (the latest and greatest).

Apparently it requires me to have:

compile 'com.google.android.gms:play-services-auth:11.8.0'

(...otherwise Android studio doesn't find GoogleSignInClient.)

Now there's where the misery starts...

As soon as I resync gradle it fails on having a different versions of

compile 'com.google.android.gms:play-services-auth:11.8.0'

and

compile 'com.google.firebase:firebase-analytics:9.0.0'
compile 'com.google.firebase:firebase-core:9.0.0'

(the two lines are added upon 'guidance' of Android Studio, the 9.0.0 version is a downgrade (see later))

First Android studio complains about com.google.firebase:firebase-analytics, if you adapt the version it complains about com.google.firebase:firebase-core and if you adapt that it stops complaining but I get this nice message upon gradle build:

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

If I do that GoogleSignInClient is not found anymore.

Actually I don't use firebase (that I know of) so disabling would already be a solution worthy the answer to this question.

So far disabling the plugin and setting this in my AndroidManifest.xml:

<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />

Didn't solve much.

Any feedback more then welcome...

S.

my top level gradle file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
        jcenter()
        maven {
            url "https://maven.java.net/content/groups/public/"
        }
        maven {
            url "https://maven.google.com"
        }
        google()
    }

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

dependencies {
}

ext {
    compileSdkVersion = 25
    buildToolsVersion = '25.0.2'
}

my project specific file:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 25
    buildToolsVersion '26.0.2'

    defaultConfig {
        applicationId "a.mystery"
        minSdkVersion 16
        targetSdkVersion 25
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:25.4.0'
    compile 'com.android.support:support-v4:25.4.0'
    compile 'ch.acra:acra:4.9.2'
    compile 'com.google.android.gms:play-services-auth:11.8.0'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'com.koushikdutta.ion:ion:2.+'
    compile('com.googlecode.json-simple:json-simple:1.1.1') {
        exclude group: 'org.hamcrest', module: 'hamcrest-core'
    }
    compile 'com.google.firebase:firebase-analytics:9.0.0'
    compile 'com.google.firebase:firebase-core:9.0.0'
}
SanThee
  • 2,301
  • 3
  • 23
  • 35

2 Answers2

0

You should add this line to the bottom of your app's build.gradle file:

apply plugin: 'com.google.gms.google-services'

And update your firebase-core dependency to the latest version:

compile 'com.google.firebase:firebase-core:11.8.0'

I see a dependency on firebase-analytics. I don't think that exists, since it is not shown in the List of Available Firebase Features.

-1

This was apparently an answer to my question:

Version conflict updating to play-services 9.4.0 Android studio 2.2

apply plugin: 'com.google.gms.google-services'

Should be below

compile 'com.google.android.gms:play-services-auth:11.8.0'

I also commented out:

//compile 'com.google.firebase:firebase-analytics:9.0.0'
//compile 'com.google.firebase:firebase-core:9.0.0'

Yet another dependency issue solved in yet another different way...

(If general debugging for this kind of stuff is given as an answer I approve that, I really hate this kind of issue and don't seem to have a general way of solving these things and my build.gradle files keep on littering is my impression...)

SanThee
  • 2,301
  • 3
  • 23
  • 35