nativescript-plugin-firebase icon indicating copy to clipboard operation
nativescript-plugin-firebase copied to clipboard

NS7.0: Plugin with id 'com.google.gms.google-services' not found.

Open brysem opened this issue 4 years ago • 7 comments

Hello,

We were using this plugin with NativeScript 6.15. After ugrading to NativeScript 7.0 the firebase plugin is providing the following error:

Script './omitted/node_modules/@nativescript/firebase/platforms/android/include.gradle' line: 96
A problem occurred evaluating script.
Plugin with id 'com.google.gms.google-services' not found.

As suggested in all of the previous issues with this same error I have run the setup again, (cd node_modules/@nativescript/firebase && npm run setup), generating all of the required hooks anew. I have attempted to reinstall all node_modules.

➜ tns info
✔ Getting NativeScript components versions information...
✔ Component nativescript has 7.0.3 version and is up to date.
✔ Component @nativescript/core has 7.0.0 version and is up to date.
✔ Component @nativescript/ios has 7.0.0 version and is up to date.
✔ Component @nativescript/android has 7.0.0 version and is up to date.
"dependencies": {
  "@nativescript/firebase": "rc", // 11.0.0-rc.5
}

Any ideas what may be wrong?

brysem avatar Sep 02 '20 14:09 brysem

Not really having an idea here, but did you change import * as firebase from @nativescript/firebase to import { firebase } from @nativescript/firebase?

That is listed as breaking change in https://nativescript.org/blog/nativescript-7-compatible-plugins/

MrSnoozles avatar Sep 03 '20 07:09 MrSnoozles

I was able to solve this issue by adding classpath "com.google.gms:google-services:4.3.0" to platforms/android/build.gradle in the dependencies block. However, this has to be done every time the platforms folder is added...

hrueger avatar Sep 05 '20 10:09 hrueger

@brysem please ensure your NS cli is 7.0.6 + @nativescript/firebase 11.0.0-rc5 it would help to fix this.

ngocnt1 avatar Sep 07 '20 00:09 ngocnt1

@ngocnt1 I have [email protected] and the issue occurs anyway...

hrueger avatar Sep 07 '20 18:09 hrueger

did you try ns platform clean android or ns platform remove/add android or ns clean because i met the same issue but it worked on 7.0.6

ngocnt1 avatar Sep 08 '20 04:09 ngocnt1

I was able to solve this issue by adding classpath "com.google.gms:google-services:4.3.0" to platforms/android/build.gradle in the dependencies block. However, this has to be done every time the platforms folder is added...

The problem is that by deleting the platforms files, you also delete information that was automatically added when you installed the firebase plugin.

Another way to solve this is to re-install the firebase plugin tns plugin remove nativescript-plugin-firebase then tns plugin add nativescript-plugin-firebase. By doing so, you leave to the cli the task to add the missing dependencies in the file platforms/android/build.gradle.

soscler avatar Sep 13 '20 18:09 soscler

I am in NS 8 and I encountered this issue, what I did was what @soscler instructed, remove and add the plugin, in addition, I deleted the platforms and hooks folder, then run tns debug android --bundle or whatever command you like, then the error is gone.

zeejay09 avatar Mar 10 '22 01:03 zeejay09

To work around this, you can try the following:

Create a new file (or add to your exisiting) called file build.gradle and add the following (or merge into the existing).

repositories {
    google()
    mavenCentral()
}

dependencies {
    classpath "com.google.gms:google-services:4.3.12"
}

armourjami avatar Oct 20 '22 23:10 armourjami