Google-signin: More than one library with package name 'com.google.android.gms.license

Created on 21 Mar 2018  路  7Comments  路  Source: react-native-google-signin/google-signin

During the build I received this error message:

Execution failed for task ':react-native-google-signin:processReleaseResources'.

Error: more than one library with package name 'com.google.android.gms.license'

Most helpful comment

allprojects {
    repositories {
        configurations.all {
            resolutionStrategy {
                force "com.google.android.gms:play-services-gcm:11.8.0"
                force 'com.google.firebase:firebase-messaging:11.8.0'
                force 'com.google.firebase:firebase-core:11.8.0'
                force 'com.google.android.gms:play-services-auth:11.8.0'
            }
        }
        ....
    }
}

I add this to my android/build.gradle file fixed the issue.
refer to here and this

All 7 comments

have the same error.
I think that's because new version of google play services

@ikhsanalatsary
I fix this by changing
compile 'com.google.android.gms:play-services-auth:+' to
compile 'com.google.android.gms:play-services-auth:11.6.0' on node_modules/react-native-google-signin/build.gradle

allprojects {
    repositories {
        configurations.all {
            resolutionStrategy {
                force "com.google.android.gms:play-services-gcm:11.8.0"
                force 'com.google.firebase:firebase-messaging:11.8.0'
                force 'com.google.firebase:firebase-core:11.8.0'
                force 'com.google.android.gms:play-services-auth:11.8.0'
            }
        }
        ....
    }
}

I add this to my android/build.gradle file fixed the issue.
refer to here and this

@ikhsanalatsary

I had the same problem, and did the same thing as you, but now I get:

:react-native-firebase:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
./node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuth.java:56: error: cannot access aet
    mAuth = FirebaseAuth.getInstance();
                        ^
  class file for com.google.android.gms.internal.aet not found
Note: ./node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuth.java uses or overrides a deprecated API.

hmm.

@lambdatoast I'm not using rn-firebase. so, maybe you should check google play service version dependencies via android studio or cd android && ./gradlew -q app:dependencies. make sure it is not version 12. if not you must override via resolution above.
reference:

if it does not work, open issue in rn-firebase GitHub

I do it as @ikhsanalatsary way.
It works But I need to do

cd android && ./gradlew clean
or
cd android && gradlew clean

Then the error disappers! 馃憤

Yup. That's it. Must clean first

Was this page helpful?
0 / 5 - 0 ratings