我正在尝试构建我的新项目,但出现此错误:
Error:Execution failed for task ':mobile:processDebugGoogleServices'. Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.julia.android.example_project"
minSdkVersion 10
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildTypes.each {
it.buildConfigField 'String', 'API_KEY', myKey
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.1'
...
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
wearApp project(':wear')
}
和
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我尝试将 apply plugin: 'com.google.gms.google-services'
移动到我的 app/build.gradle 文件的底部,但没有成功。
有什么想法吗?
最佳答案
今天早些时候遇到了这个问题。在应用 android 应用程序插件之前,只需应用 google 服务插件。
更新以下行:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
到:
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
关于android - Google Play 服务 GCM 10.0.1 要求将 “update” 返回到 9.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41010208/