Gradle 错误:任务 ':app:processDebugGoogleServices' 的执行失败 [英] Gradle Error:Execution failed for task ':app:processDebugGoogleServices'

查看:77
本文介绍了Gradle 错误:任务 ':app:processDebugGoogleServices' 的执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在点击此链接将 Google 登录集成到我的 android 应用中.https://developers.google.com/identity/sign-in/android/start-integrating正如上面给定页面的最后一步中给出的,我们必须包含依赖项

I am following this link to integrate Google sign-in in my android app.https://developers.google.com/identity/sign-in/android/start-integrating As given in last step on the above given page we have to include dependency

 compile 'com.google.android.gms:play-services-auth:8.3.0' 

在应用程序级 build.gradle 文件中,但这样做并构建项目时出现错误提示

in app-level build.gradle file but doing so and building project an error comes saying

Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict.

build.gradle(Module:app)

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.brainbreaker.socialbuttons"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.google.android.gms:play-services-auth:8.3.0'
}

在 build.gradle 文件中,编译依赖行 compile 'com.google.android.gms:play-services-auth:8.3.0' 显示错误

In the build.gradle file the compile dependency line compile 'com.google.android.gms:play-services-auth:8.3.0' shows error

所有 com.google.android.gms 库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃).成立版本 8.3.0、8.1.0.例子包括com.google.android.gms:play-services-base:8.3.0 和com.google.android.gms:play-services-measurement:8.1.0 有一些库或工具和库的组合,即不兼容,或可能导致错误.一种这样的不兼容性是使用非 Android 支持库的版本进行编译最新版本(或者特别是低于您的版本)targetSdkVersion.)

All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 8.3.0, 8.1.0. Examples include com.google.android.gms:play-services-base:8.3.0 and com.google.android.gms:play-services-measurement:8.1.0 There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion.)

这里是 gradle build 的消息.

Here are the messages of gradle build.

Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :social_buttons:generateDebugSources, :social_buttons:generateDebugAndroidTestSources, :social_buttons:compileDebugSources, :social_buttons:compileDebugAndroidTestSources]
:clean UP-TO-DATE
:app:clean
:social_buttons:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library
:app:prepareComAndroidSupportDesign2301Library
:app:prepareComAndroidSupportSupportV42301Library
:app:prepareComGoogleAndroidGmsPlayServicesAds810Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library
:app:prepareComGoogleAndroidGmsPlayServicesAuth830Library
:app:prepareComGoogleAndroidGmsPlayServicesBase830Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement830Library
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
Found com.google.android.gms:play-services-auth:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-auth:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-auth:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-auth:8.3.0, but version 8.1.0 is needed
Found com.google.android.gms:play-services-auth:8.3.0, but version 8.1.0 is needed
:app:processDebugGoogleServices FAILED
Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict.
Information:BUILD FAILED
Information:Total time: 3.49 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

我无法找到解决此版本冲突的任何方法.任何帮助表示赞赏.

I am not able to see any way out for this version conflict. Any help is appreciated.

推荐答案

我遇到了同样的问题.但现在我固定了.

I'v got a same issue. but Now I'm fixed.

您应该删除一行 apply plugin: 'com.google.gms.google-services'

因为com.android.application"包已经有相同的包.

because "com.android.application" package already has same package.

这篇关于Gradle 错误:任务 ':app:processDebugGoogleServices' 的执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆