cordova-plugin-firebase: Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin'] > For input string: "+", again

Even after installing cordova-android-{firebase,support,play-services}-gradle-release, I still get

Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
   > For input string: "+"

I notice the following two lines referring to different versions of com.google.gms:google-servcies:

plugins/cordova-plugin-firebase/src/android/build.gradle:6:        classpath 'com.google.gms:google-services:3.1.0'
plugins/cordova-support-google-services/build.gradle:9:        classpath 'com.google.gms:google-services:3.2.0'

Could this 3.1.0 vs. 3.2.0 be the problem, and if so how would one deal with that?

I am also using cordova-plugin-firebase-dynamiclinks, if that is relevant. I notice that there is a version 1.2 of the google services plugin, which references v4.0 of com.google.gms:google-services; is there any point in trying that?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 19 (1 by maintainers)

Most upvoted comments

Hi @rtm for fix this problem go to /platforms/android/cordova-support-google-services

In this directory find the file {APP}-build.gradle

Open and comment the next line

apply plugin: com.google.gms.googleservices.GoogleServicesPlugin

Next, re run

ionice cordova run android

I’ve pulled the plug on Cordova and its hot mess of version conflicts between Android, Cordova, Cordova platforms, and Cordova plugins. I wasted far too many hours and days of my life trying to get things to work. I delayed new features because I knew the pain that would be involved. I’m writing PWAs now, and life is sweet. Just say no.

@DualH solution is no good. I implemented it a few weeks ago, thought I was good to go… I just went through many hours of debug not knowing why Google Login wasn’t working anymore. Then I remembered about this. Removed the plugin that was giving errors, removed my fix, rebuilt everything… It works again. Be very careful when implementing this solution.

Thank you very much @DualH

Thank you so much @DualH

Hello, why this is close? What is the fix? I still encounter this issue:

` Failed to apply plugin [id ‘com.google.gms.google-services’]

Cannot add extension with name ‘googleServices’, as there is an extension already registered with that name. `

My ionic info:

` cli packages: (/usr/local/lib/node_modules)

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

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.2.0
Cordova Platforms  : android 7.1.4
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v8.11.4
npm               : 5.6.0
OS                : macOS High Sierra
Xcode             : Xcode 10.1 Build version 10B61

Environment Variables:

ANDROID_HOME : /Users/zento/Library/Android/sdk

Misc:

backend : pro

`

We have to integrate with Jenkins for CI. And as for other the fix from @DualH is resolving the build, but then the plugin won’t works.

What is the resolution for this closed issue please?

Thanks @DualH for the solution ! However, this involves changing a generated file. It will be tricky to implement on a automated build (ex: on Ionic AppFlow or Jenkins). Does someone have a solution suitable for continuous integration ?

fixed it!

@rtm don’t give up on cordova! you can do it!