I'm trying to include com.google.gms:google-services:3.0.0
into my cordova plugin without having to hack it into the main build.gradle
file. I have added the following file to my application:
build-extras.gradle
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
}
}
apply plugin: 'com.google.gms.google-services'
I get the following error when trying to build the application:
* Where:
Script 'platforms/android/build-extras.gradle' line: 11
* What went wrong:
A problem occurred evaluating script.
> Plugin with id 'com.google.gms.google-services' not found.
I have attempted including build-extras.gradle
using <framework src="src/android/build-extras.gradle" custom="true" type="gradleReference" />
and also manually copying it into platforms/android
.
Cordova Reference: https://cordova.apache.org/docs/en/latest/guide/platforms/android/#extending-buildgradle
Google Reference: https://developers.google.com/identity/sign-in/android/start-integrating
If I take that same code from build-extras.gradle
and directly append then to the end of build.gradle
it seems to work. Any thoughts on how I can get this to work in my build-extras.gradle
file?