nativescript-plugin-firebase
nativescript-plugin-firebase copied to clipboard
NS7.0: Plugin with id 'com.google.gms.google-services' not found.
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?
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/
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...
@brysem please ensure your NS cli is 7.0.6 + @nativescript/firebase 11.0.0-rc5 it would help to fix this.
@ngocnt1 I have [email protected]
and the issue occurs anyway...
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
I was able to solve this issue by adding
classpath "com.google.gms:google-services:4.3.0"
toplatforms/android/build.gradle
in thedependencies
block. However, this has to be done every time theplatforms
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
.
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.
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"
}