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

I have tried now with changes, but couldnt resolve the issue. Is there any other file u changed?
after changes

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

I have tried create creating a new ionic project with just adding only “cordova-plugin-firebase” and tried to build the package, facing this issue. I think there is something wrong with this plugin.

If possible can you create a new project, add cordova-plugin-firebase and try to build the package. I know it is too much to ask. Only if possible please do, as many people are facing this issue.

Thanks

@sampath @AlvaroHerrero , Do we need to change the firebase porperties to 11+ in only project.properties file ???

what about the other files like build.gradle and android/cordova-plugin-firebase/app-build.gradle??

Yes, I did there only. No other places and all are working fine on my app :slight_smile:

Thank you so much. you saved our time :ok_hand: .
keep it up :+1:

you have to change this
cordova.system.library.6=com.google.gms:google-services:+

to this

cordova.system.library.6=com.google.gms:google-services:11.+

@sampath @AlvaroHerrero @Thesurya9

I have changed in all places, got a different error this time :thinking: :thinking:

here is my prorerties file
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 the Error is:

  • What went wrong:
    A problem occurred configuring root project ‘android’.

Could not resolve all dependencies for configuration ‘:_debugApkCopy’.

BUILD FAILED

Total time: 8.075 secs
Could not find any version that matches com.google.gms:google-services:11+.
Versions that do not match:
3.2.0
3.1.2
3.1.1
3.1.0
3.0.0
+ 42 more
Required by:
project :

Please try this for that error:

<widget id="com.acme.appname" version="0.0.1" android-versionCode="1" ios-CFBundleVersion="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

And also you need to do like so 11.+

Not working here too.
Changed everything to…

target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:appcompat-v7:26+
cordova.gradle.include.1=com.synconset.imagepicker/shiftcommunicator-ignorelinterrors.gradle
cordova.gradle.include.2=com.synconset.imagepicker/shiftcommunicator-androidtarget.gradle
cordova.gradle.include.3=cordova-plugin-code-push/shiftcommunicator-build-extras.gradle
cordova.gradle.include.4=cordova-plugin-firebase/shiftcommunicator-build.gradle
cordova.system.library.2=com.google.firebase:firebase-crash:11.+
cordova.system.library.3=com.google.firebase:firebase-config:11.+
cordova.system.library.4=com.android.support:support-v4:26.+
cordova.system.library.5=com.google.gms:google-services:11.+
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.gradle.include.5=cordova-android-support-gradle-release/shiftcommunicator-cordova-android-support-gradle-release.gradle

Including adding android-versionCode=“1” to config.xml

  • What went wrong:
    A problem occurred configuring root project ‘android’.

Could not resolve all dependencies for configuration ‘:_debugApkCopy’.
Could not find any version that matches com.google.gms:google-services:11.+.
Versions that do not match:
3.2.0
3.1.2
3.1.1
3.1.0
3.0.0
+ 42 more
Required by:
project :

tried both of them no good

can you share your cordova and npm versions

I am also facing same issue can any one please help…

cli packages: (C:\Users\lokuge\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 25.2.5
Node              : v6.10.0
npm               : 3.10.10
OS                : Windows 8.1

Environment Variables:

ANDROID_HOME : C:\Program Files (x86)\Android\android-sdk

Misc:

backend : pro

@sampath

I have added 11.+ and still I am getting the same error. Is there anything else to change? and any other files??

Could you show your whole project.properties file?

Finally Solved it by doing this.

if youre getting more than one library with package name ‘com.google.android.gms.license’
ionic this error,

change all firebase properties in project.properties file from + to 11.+
and change firebase property in android/cordova-firebase-plugin/app-build.gradle file from **+ ** to 11.+.

by doing that i got another error
and the Error is:

What went wrong:
A problem occurred configuring root project ‘android’.
Could not resolve all dependencies for configuration ‘:_debugApkCopy’.

BUILD FAILED

Total time: 8.075 secs
Could not find any version that matches com.google.gms:google-services:11+.
Versions that do not match:
3.2.0
3.1.2
3.1.1
3.1.0
3.0.0
+ 42 more
Required by:
project

this is got resolved by updating you android SDK libraries
Google play licensing library and
Google play expansion library
Google play license services
Google repository

Hope this works :grinning:

1 Like

target=android-25
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.+

It must be a android-26

1 Like

I have used this: ionic cordova platform add android@6.3.0

I have updated. But still it shows the below error

A problem occurred configuring root project ‘android’.

Could not resolve all dependencies for configuration ‘:_debugApkCopy’.
Could not find any version that matches com.google.gms:google-services:11.+.
Versions that do not match:
3.2.0
3.1.2
3.1.1
3.1.0
3.0.0
+ 42 more
Required by:
project

1 Like