问题
I am using google services at the very first time in my app(ionic platform). I am following this doc. While building my app, I got the following error message. Please help out. Thank you.
A problem occurred evaluating script.
Plugin with id 'com.google.gms.google-services' not found.
回答1:
Please add the plugin to your project by updating your top-level build.gradle
and your app-level build.gradle
files as follows:
- Add the dependency to your project-level build.gradle:
classpath 'com.google.gms:google-services:3.0.0'
- Add the plugin to your app-level build.gradle:
apply plugin: 'com.google.gms.google-services'
More information regarding this can be found in GCM - Set up a GCM Client App on Android.
And, in addition to that, the guide or workaround given in GitHub - GCMPushPlugin might also help.
回答2:
Add classpath com.google.gms:google-services:3.0.0 dependencies at project level build.gradle
Refer the sample block from project level build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
来源:https://stackoverflow.com/questions/38611257/plugin-with-id-com-google-gms-google-services-not-found