question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to build - more than one library with package name 'com.google.android.gms.license'

See original GitHub issue

Current behavior

react-native run-android

:react-native-device-info:processReleaseManifest :react-native-device-info:processReleaseResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:react-native-device-info:processReleaseResources’.

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

BUILD FAILED

Total time: 42.342 secs

Expected behavior

It was working fine the previous day. no changes was made to build.gradle files

dependecies

dependencies {
    compile project(':react-native-splash-screen')
    compile project(':react-native-svg')
    compile project(':react-native-linear-gradient')
    compile 'com.facebook.fresco:fresco:1.5.0'
    compile 'com.facebook.fresco:animated-gif:1.5.0'
    compile project(':react-native-fetch-blob')
    compile group: 'net.lingala.zip4j', name: 'zip4j', version: '1.3.2'
    compile project(':appcenter-crashes')
    compile project(':appcenter-analytics')
    compile project(':appcenter')
    compile project(':react-native-code-push')
    compile project(':react-native-sentry')
    compile 'com.amplitude:android-sdk:2.13.4'
    compile project(':react-native-amplitude-analytics')
    compile project(':react-native-fbsdk')
    compile(project(":react-native-google-signin")){
      exclude group: "com.google.android.gms" // very important
    }
    compile 'com.google.android.gms:play-services-auth:9.2.1' // should be at least 9.0.0
    compile project(':react-native-orientation-locker')
    compile(project(':react-native-device-info')) {
      exclude group: "com.google.android.gms" // very important
    }
    compile project(':react-native-vector-icons')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:27.0.2"
    compile "com.facebook.react:react-native:+"  // From node_modules
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:13

github_iconTop GitHub Comments

17reactions
GaudamThiyagarajancommented, Mar 21, 2018
allprojects {
    repositories {
        configurations.all {
            resolutionStrategy {
                force "com.google.android.gms:play-services-gcm:11.8.0"
            }
        }
        ....
   }
}

adding this to my android/build.gradle file fixed the issue.

looks like something to do with new release of Google Play services 12.0.0(released at March 20, 2018)

note: I had to add force “com.google.android.gms:play-services-auth:11.8.0” as i was using google sign in.

5reactions
machourcommented, Mar 21, 2018

Hi @GaudamThiyagarajan,

Instead of the resolutionStrategy thing, could you try defining the following variable in your android/build.gradle file:

ext { googlePlayServicesVersion = “11.8.0” }

that would tell react-native-device-info to use that version for com.google.android.gms.

Let me know if that fixes the issue for you so that I can make this clearer in the README (it’s actually hidden under Android linking)

Read more comments on GitHub >

github_iconTop Results From Across the Web

than one library with package name com.google.android.gms ...
It is important to include all firebase and all android.gms library references, if you miss just one from here, it will still fail...
Read more >
than one library with package name 'com.google.android.gms ...
@btoueg There is a known issue with Build Tools 3 (#16906) causing a build for release to fail. The fix is to add...
Read more >
Firebase: Android build error with Error: more than one library ...
I am trying to build android apk, but the build command failed with error,. 'Error: more than one library with package name 'com.google.android....
Read more >
Error: more than one library with package name com.google.android ...
Android : Error: more than one library with package name com.google.android.gms.license [ Beautify Your Computer ... Your browser can't play this video.
Read more >
Include open source notices | Google Play services
One of these tools is a Gradle plugin that collects license terms from included libraries ... classpath("com.google.android.gms:oss-licenses-plugin:0.10.6")
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found