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

This is working fine

Hi guys. i changed my firebase/build.gradle into
dependencies {
compile 'me.leolin:ShortcutBadger:1.1.4@aar’
compile 'com.google.firebase:firebase-crash:11.+'
compile ‘com.google.firebase:firebase-auth:+’
}

but still i’m getting this issue
Execution failed for task ‘:processDebugResources’.

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

Hi,

what did you change in cordova-plugin-firebase, to make it work?

As I am using the same plugin and unable to build.

Thanks

I personnaly have several plugins failing with cordova 7.0.0
I went back on 6.3.0 and applied the fix this way (because I have other dependencies failing for some reasons)

At the end of build.gradle :

configurations.all {
    resolutionStrategy {
        force 'com.google.firebase:firebase-core:11+'
        force 'com.google.firebase:firebase-messaging:11+'
    }
}

replace or add any com.google.firebase you have in your build.gradle

1 Like

Hi @gattur,

Using Android build error with Error: more than one library with package name 'com.google.android.gms.license' solved issue for me.

Thanks.

1 Like

Hi @akhiilsanker

Thanks.

my project.properties content

cordova.system.library.1=com.google.android.gms:play-services-tagmanager:11.+
cordova.gradle.include.1=cordova-plugin-googlemaps/starter-tbxml-android.gradle
cordova.system.library.2=com.google.android.gms:play-services-maps:11.8.0
cordova.system.library.3=com.google.android.gms:play-services-location:11.8.0
cordova.system.library.4=com.android.support:support-core-utils:24.1.0
cordova.gradle.include.2=cordova-plugin-firebase/starter-build.gradle
cordova.system.library.5=com.google.gms:google-services:+
cordova.system.library.6=com.google.android.gms:play-services-tagmanager:+
cordova.system.library.7=com.google.firebase:firebase-core:+
cordova.system.library.8=com.google.firebase:firebase-messaging:+
cordova.system.library.9=com.google.firebase:firebase-crash:+
cordova.system.library.10=com.google.firebase:firebase-config:+

modified to

cordova.system.library.1=com.google.android.gms:play-services-tagmanager:11.+
cordova.gradle.include.1=cordova-plugin-googlemaps/starter-tbxml-android.gradle
cordova.system.library.2=com.google.android.gms:play-services-maps:11.+
cordova.system.library.3=com.google.android.gms:play-services-location:11.+
cordova.system.library.4=com.android.support:support-core-utils:24.1.0
cordova.gradle.include.2=cordova-plugin-firebase/starter-build.gradle
cordova.system.library.5=com.google.gms:google-services:+
cordova.system.library.6=com.google.android.gms:play-services-tagmanager:11.+
cordova.system.library.7=com.google.firebase:firebase-core:11.+
cordova.system.library.8=com.google.firebase:firebase-messaging:11.+
cordova.system.library.9=com.google.firebase:firebase-crash:11.+
cordova.system.library.10=com.google.firebase:firebase-config:11.+

Still facing the same issue, I had tried adding each plugin and checked which plugin causing the issue. I could see cordova-plugin-firebase is causing the issue.

Thanks

This solution works!
This strings need to be changed in file:
platform/android/project.properties

@Reactor was the reply to me.

I had changed only platform/android/project.properties, Is there any other file that needs to be changed?

Thanks

So I was using an old version of phonegap-plugin-push, and I had to change in my project.properties

cordova.system.library.2=com.google.android.gms:play-services-analytics:+

to

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

And now it works! :slight_smile:

I’m had also changed:
android/cordova/lib/builders/GradleBuild.js

[/^/?google/google_play_services/libproject/google-play-services_lib/?$/, ‘com.google.android.gms:play-services:+’]

to

[/^/?google/google_play_services/libproject/google-play-services_lib/?$/, ‘com.google.android.gms:play-services:11.+’]

Hi guys,

Still facing the same problem. Made changes in all locations but no good.

Here are my changes.

in project.properties file: changed + to 11+

target=android-26
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-firebase/app-build.gradle
cordova.system.library.1=com.google.gms:google-services:11+
cordova.system.library.2=com.google.android.gms:play-services-tagmanager:11+
cordova.system.library.3=com.google.firebase:firebase-core:11+
cordova.system.library.4=com.google.firebase:firebase-messaging:11+
cordova.system.library.5=com.google.firebase:firebase-crash:11+
cordova.system.library.6=com.google.firebase:firebase-config:11+

and cordova-plugin-firebase/app-build.gradle added 11+ previously +
compile 'com.google.firebase:firebase-crash:11+'
compile ‘com.google.firebase:firebase-auth:11+’

and in build.gradle file added at end of file

configurations.all {
resolutionStrategy {
force 'com.google.firebase:firebase-crash:11+'
force 'com.google.firebase:firebase-auth:11+'
force 'com.google.firebase:firebase-core:11+'
force ‘com.google.firebase:firebase-messaging:11+’
}
}

no use, can any one help me where am doing wrong?

Thanks

Isn’t working for me too… I need help…

Not worked for me. Any help?

Hi guys,

It solved my issue, but will be great understand why this is happening and how we can avoid new problems like this. Does anybody have an idea in this sense?

@mserravalle Can you post your output and your project.properties relevant contents?

It seems you didn’t change all the places. Please see my file and adjust it to your side.

project.properties

target=android-26
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-badge/budgetmyreno-badge.gradle
cordova.system.library.1=com.android.support:support-v4:26.0.0+
cordova.system.library.2=com.facebook.android:facebook-android-sdk:4.+
cordova.system.library.3=com.android.support:support-v4:26.+
cordova.gradle.include.2=cordova-plugin-firebase/budgetmyreno-build.gradle
cordova.system.library.4=com.google.gms:google-services:+
cordova.system.library.5=com.google.android.gms:play-services-tagmanager:11.+
cordova.system.library.6=com.google.firebase:firebase-core:11.+
cordova.system.library.7=com.google.firebase:firebase-messaging:11.+
cordova.system.library.8=com.google.firebase:firebase-crash:11.+
cordova.system.library.9=com.google.firebase:firebase-config:11.+
cordova.system.library.10=com.google.android.gms:play-services-auth:11.+
cordova.system.library.11=com.google.android.gms:play-services-identity:11.+
cordova.system.library.12=com.android.support:support-v4:26.+
cordova.gradle.include.3=cordova-plugin-local-notification/budgetmyreno-localnotification.gradle
cordova.system.library.13=com.android.support:support-v4:26.0.0+

this is my project.properties. I tried change to 11.+ all firebase. But isn’t working

target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:appcompat-v7:23+
cordova.gradle.include.1=com.synconset.imagepicker/shiftapp-ignorelinterrors.gradle
cordova.gradle.include.2=com.synconset.imagepicker/shiftapp-androidtarget.gradle
cordova.system.library.2=com.android.support:support-v4:24.1.1+
cordova.system.library.3=com.facebook.android:facebook-android-sdk:4.+
cordova.gradle.include.3=cordova-plugin-firebase/shiftapp-build.gradle
cordova.system.library.4=com.google.gms:google-services:+
cordova.system.library.5=com.google.android.gms:play-services-tagmanager:+
cordova.system.library.6=com.google.firebase:firebase-core:+
cordova.system.library.7=com.google.firebase:firebase-messaging:+
cordova.system.library.8=com.google.firebase:firebase-crash:+
cordova.system.library.9=com.google.firebase:firebase-config:+
cordova.system.library.10=com.google.android.gms:play-services-maps:+
cordova.system.library.11=com.google.android.gms:play-services-location:+
cordova.gradle.include.4=cordova-plugin-mauron85-background-geolocation/shiftapp-logtofile.gradle
cordova.system.library.12=com.google.android.gms:play-services-location:+
cordova.system.library.13=com.android.support:support-v4:+
cordova.system.library.14=com.android.support:support-v4:26.+
cordova.system.library.15=com.android.support:appcompat-v7:26.+

This is my project properties now. But still not working

target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:appcompat-v7:23+
cordova.gradle.include.1=com.synconset.imagepicker/shiftapp-ignorelinterrors.gradle
cordova.gradle.include.2=com.synconset.imagepicker/shiftapp-androidtarget.gradle
cordova.system.library.2=com.android.support:support-v4:24.1.1+
cordova.system.library.3=com.facebook.android:facebook-android-sdk:4.+
cordova.gradle.include.3=cordova-plugin-firebase/shiftapp-build.gradle
cordova.system.library.4=com.google.gms:google-services:+
cordova.system.library.5=com.google.android.gms:play-services-tagmanager:11.+
cordova.system.library.6=com.google.firebase:firebase-core:11.+
cordova.system.library.7=com.google.firebase:firebase-messaging:11.+
cordova.system.library.8=com.google.firebase:firebase-crash:11.+
cordova.system.library.9=com.google.firebase:firebase-config:11.+
cordova.system.library.10=com.google.android.gms:play-services-maps:11.+
cordova.system.library.11=com.google.android.gms:play-services-location:11.+
cordova.gradle.include.4=cordova-plugin-mauron85-background-geolocation/shiftapp-logtofile.gradle
cordova.system.library.12=com.google.android.gms:play-services-location:11.+
cordova.system.library.13=com.android.support:support-v4:+
cordova.system.library.14=com.android.support:support-v4:26.+
cordova.system.library.15=com.android.support:appcompat-v7:26.+

I solved this changing

cordova.system.library.1=com.google.android.gms:play-services-analytics:+

to

cordova.system.library.1=com.google.android.gms:play-services-analytics:11.+

in platforms/android/project.properties.
They updated (12.0.0) the plugin yesterday so something is broken:
https://developers.google.com/android/guides/releases

target=android-26
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-badge/android-badge.gradle
cordova.system.library.1=com.google.android.gms:play-services-maps:+
cordova.system.library.2=com.google.android.gms:play-services-location:+
cordova.system.library.3=com.android.support:support-v4:26.+
cordova.gradle.include.2=cordova-plugin-local-notification/android-localnotification.gradle
cordova.gradle.include.3=cordova-plugin-qrscanner/android-qrscanner.gradle
cordova.gradle.include.4=cordova-plugin-firebase/android-build.gradle
cordova.system.library.4=com.google.gms:google-services:+
cordova.system.library.5=com.google.android.gms:play-services-tagmanager:+
cordova.system.library.6=com.google.firebase:firebase-core:+
cordova.system.library.7=com.google.firebase:firebase-messaging:+
cordova.system.library.8=com.google.firebase:firebase-crash:+
cordova.system.library.9=com.google.firebase:firebase-config:+1:

same issue after added ionic firebase plugin

pleeessseee heeeelllppp

Please see this: Android build error with Error: more than one library with package name 'com.google.android.gms.license'