Error :
任务':app:processDebugGoogleServices'的执行失败 . 请通过更新google-services插件的版本(此处提供有关最新版本的信息)或将com.google.android.gms的版本更新为8.3.0来修复版本冲突 .
我已经完成了我发现的所有事情 .
dependencies {
// This does not break the build when Android Studio is missing the JRebel for Android plugin.
classpath 'com.zeroturnaround.jrebel.android:jr-android-gradle:1.0.+'
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
并在应用程序gradle中
compile 'com.google.android.gms:play-services:8.4.0'
14 回答
将这些依赖项用于项目build.gradle
并将其放在app级build.gradle文件的末尾(在依赖项之后) .
我不知道为什么把它放在最后(而不是在开头)解决了错误 .
EDIT 5/1/2016
好的......所以试图结束你们所遇到的所有问题我的解决方案
这是我最后的应用程序级别
这是我最后的项目级别
将其与您自己的gradle文件进行比较,并添加或修改任何与我编写的值不同的值 .
在应用程序的模块(build.gradle)中
搬家:
到最后一行解决了这个问题 .
请执行下列操作:
请检查here以获取最新版本,因为此更改 .
这似乎是使用版本3.0.0的Google服务插件(以及Google Play服务库的9.0.0版本)修复的 . 所以这个
顶级build.gradle
app level build.gradle
快速注意:如果要更新到
google-services
插件的3.0.0版,请确保重新生成配置文件,因为它有新字段(解释here) .编辑(2016-06-20):虽然这确实编译并运行,但我注意到在构建日志中它确实指定将插件放在文件的底部,否则将使用默认(9.0.0) . 所以在上面的情况中,这不是日志:
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used. please apply google-services plugin at the bottom of the build file.
对我来说只有这个:
顶层 .
应用级别:
在官方例子中找到
在项目gradle中
在app gradle中
我已经在app build.gradle中更新了
和app build.gradle
它的工作 .
在我的情况下,我已从gradle.build的末尾删除了“apply plugin:'com.google.gms.google-services'”并且工作正常 .
重要的是 set Gradle to Version 2.10
https://stackoverflow.com/a/35188079/570168
我在浏览...在Google页面上有解决方案... https://developers.google.com/android/guides/google-services-plugin#introduction
添加已启用服务所需的基本库的依赖项 . 此步骤需要apply插件:'com.google.gms.google-services' line be at the end of your app/build.gradle file so that no dependency collisions are introduced. 您可以通过运行./gradlew:app:dependencies来查看此步骤的结果 .
移动apply插件没有意义:
'com.google.gms.google-services
'到 build.gradle 的末尾 . 它与未定义它相同 .只需删除此行并确保应用插件:'
com.android.application
'就在那里使用:
它会编译 .
在项目gradle中
在app / module gradle中
在项目gradle中:
这是工作 .
这是我的修复指令 .
更改为在应用中使用
compile 'com.google.android.gms:play-services-location:8.3.0'
build.gradle
将
apply plugin: 'com.google.gms.google-services'
移至appbuild.gradle
的末尾在项目
build.gradle
依赖项中使用classpath 'com.google.gms:google-services:2.0.0-alpha3'
在
gradle/wrapper/gradle-wrapper.properties
中更改以使用gradle-2.8