gpt4 book ai didi

android - Gradle 错误 :Execution failed for task ':app:processDebugGoogleServices'

转载 作者:IT老高 更新时间:2023-10-28 13:22:01 24 4
gpt4 key购买 nike

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

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

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

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' 显示错误

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 的消息。

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

我看不到任何解决此版本冲突的方法。任何帮助表示赞赏。

最佳答案

我也有同样的问题。但现在我已经解决了。

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

因为“com.android.application”包已经有相同的包了。

关于android - Gradle 错误 :Execution failed for task ':app:processDebugGoogleServices' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33572465/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com