Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native - more than one library with package name 'com.google.android.gms.license'

Tags:

react-native

i know it causes due to google new version update of gms to 12.0.0 here is link https://developers.google.com/android/guides/releases

add in android/build.gradle but now its not compiling onesignal coz it also uses Google service with different version

other solution on github suggest me to add '+' in dependencies but it's not working

configurations.all {
            // #PlayServicesGate — March, 20 2018
            resolutionStrategy {
            force 'com.google.android.gms:play-services-auth:11.8.0'

            // Firebase dependencies
            force "com.google.android.gms:play-services-base:11.8.0"
            force 'com.google.firebase:firebase-core:11.8.0'
            force 'com.google.firebase:firebase-auth:11.8.0'
            }
        }

please let me know if anyone know about this

    :react-native-onesignal:prepareComGoogleAndroidGmsPlayServicesTagmanagerV4Impl1200Library
    :react-native-onesignal:prepareComGoogleAndroidGmsPlayServicesTagmanagerV4ImplLicense1200Library
    :react-native-onesignal:prepareComGoogleAndroidGmsPlayServicesTasks1200Library
    :react-native-onesignal:prepareComGoogleAndroidGmsPlayServicesTasksLicense1200Library
    :react-native-onesignal:prepareComOnesignalOneSignal382Library
    :react-native-onesignal:prepareOrgWebkitAndroidJscR174650Library
    :react-native-onesignal:prepareReleaseDependencies
    :react-native-onesignal:compileReleaseAidl
    :react-native-onesignal:compileReleaseNdk UP-TO-DATE
    :react-native-onesignal:compileLint
    :react-native-onesignal:copyReleaseLint UP-TO-DATE
    :react-native-onesignal:compileReleaseRenderscript
    :react-native-onesignal:generateReleaseBuildConfig
    :react-native-onesignal:generateReleaseResValues
    :react-native-onesignal:generateReleaseResources
    :react-native-onesignal:mergeReleaseResources
    :react-native-onesignal:processReleaseManifest
    :react-native-onesignal:processReleaseResources FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':react-native-onesignal:processReleaseResources'.
    > Error: more than one library with package name 'com.google.android.gms.license'

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED

    Total time: 3 mins 7.465 secs
    Error: /Users/vsts/agent/2.131.0/work/1/s/android/gradlew failed with return code: 1
        at ChildProcess.<anonymous> (/Users/vsts/agent/2.131.0/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/1.128.0/node_modules/vsts-task-lib/toolrunner.js:569:30)
        at emitTwo (events.js:106:13)
        at ChildProcess.emit (events.js:191:7)
        at maybeClose (internal/child_process.js:886:16)
        at Socket.<anonymous> (internal/child_process.js:342:11)
        at emitOne (events.js:96:13)
        at Socket.emit (events.js:188:7)
        at Pipe._handle.close [as _onclose] (net.js:497:12)
like image 891
Jigar Avatar asked Mar 21 '18 11:03

Jigar


1 Answers

go to project.properties and change the following lines:

cordova.system.library.2=com.google.android.gms:play-services-gcm:+ cordova.system.library.3=com.google.android.gms:play-services-location:+

To

cordova.system.library.2=com.google.android.gms:play-services-gcm:11+ cordova.system.library.3=com.google.android.gms:play-services-location:11+

It worked for me :)

like image 91
Abir.d Avatar answered Oct 19 '22 23:10

Abir.d