本文介绍了Google服务冲突错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图建立我的项目,但突然开始在我的日志猫上发现这个关于谷歌服务版本冲突的令人沮丧的错误。我已经尝试了所有可能的解决方案,以解决问题,但它不工作。我更新了我的 google-services.json 文件,甚至升级了我的Google服务依赖项,清理并重建了我的项目,甚至失效了缓存,但仍然收到相同的错误。 Build.gradle(app)
apply plugin:'com.android。应用程序'
android {
compileSdkVersion 25
buildToolsVersion26.0.1
defaultConfig {
applicationIdcom.example.app
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName1.0
testInstrumentationRunnerandroid.support.test.runner.AndroidJUnitRunner
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
依赖项{
编译fileTree(dir:'libs',include:['* .jar'])
编译项目(路径:':Material-Color-Picker-master')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2' ,{
exclude group:'com.android.support',module:'support-annotations'
})
apply plugin:'com.google.gms.google-services'
编译文件('libs / YouTubeAndroidPlayerApi.jar')
编译'com.android.support:appcompat-v7:25.3.1'
编译'com.android.support.constraint :constraint-layout:1.0.2'
compile'com.android.support:design:25.3.1'
compile'com.google.android.gms:play-services-maps:11.6.0 '
compile'com.google.firebase:firebase-crash:11.6.0'
compile'com.google.firebase:firebase-database:11.6.0'
compile'com.google .firebase:firebase-messaging:11.6.0'
testCompile'junit:junit:4.12'
}
apply plugin:'com.google.gms.google-services'
Build.gradle(Project)
// Top-您可以在其中添加所有子项目/模块通用的配置选项。
$ b buildscript {
repositories {
jcenter()
}
依赖关系{
classpath'com.android.tools.build:gradle: 2.3.3'
classpath'com.google.gms:google-services:3.1.1'
classpath'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
//注意:不要在这里放置您的应用程序依赖关系;它们属于单个模块build.gradle文件中的
//
}
}
allprojects {
存储库{
maven {url https://maven.google.com}
jcenter()
}
}
任务清理(类型:删除){
删除rootProject .buildDir
}
错误
错误:任务':app:processDebugGoogleServices'的执行失败。
>请通过更新google-services插件的版本来修复版本冲突(有关最新版本的信息,请访问https://bintray.com/android/android-tools/com.google.gms.google-services/)或将com.google.android.gms的版本更新为9.0.0。
解决方案
我终于解决了这个问题, build.gradle(project)模块。
classpath'com.google.gms:google-services :3.1.1'
Am trying to build my project but suddenly started getting this frustrating error on my log cat about google services version conflict. I have tried all the possible solutions online to fix things yet its not working. I have updated my google-services.json file, even upgraded my google-servies dependencies, cleaned and rebuild my project even invalidated caches yet still getting same error.
Build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(path: ':Material-Color-Picker-master')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
apply plugin: 'com.google.gms.google-services'
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Build.gradle (Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://maven.google.com" }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Error
Error:Execution failed for task ':app: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.
解决方案
I finally solved this problem by removing this line from my build.gradle(project) module.
classpath 'com.google.gms:google-services:3.1.1'
这篇关于Google服务冲突错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!