问题描述
我正在尝试为 Android 实现 Google 登录,我正在通过
按照说明进行操作https://developers.google.com/identity/sign-in/android/start-整合
但是在构建应用程序时,我收到以下错误.
信息:Gradle 任务 [:app:generateDebugSources,:app:generateDebugAndroidTestSources, :app:assembleDebug]:app:preBuild 最新版本 :app:preDebugBuild 最新版本:app:checkDebugManifest :app:preReleaseBuild 最新版本:app:prepareComAndroidSupportAppcompatV72301库更新:app:prepareComAndroidSupportDesign2301Library 最新:app:prepareComAndroidSupportSupportV42301Library 最新:app:prepareComGoogleAndroidGmsPlayServicesAds810Library 最新:app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library最新:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library最新 :app:prepareComGoogleAndroidGmsPlayServicesBase810Library最新:app:prepareComGoogleAndroidGmsPlayServicesBasement810Library最新:app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library最新:app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library最新 :app:prepareComGoogleAndroidGmsPlayServicesPlus810Library最新 :app:prepareDebugDependencies :app:compileDebugAidl最新 :app:compileDebugRenderscript 最新:app:generateDebugBuildConfig 更新日期 :app:generateDebugAssets最新 :app:mergeDebugAssets 最新:app:generateDebugResValues 最新 :app:processDebugGoogleServices找不到与包名称com.questo.rugved.questo"匹配的客户端:app:generateDebugResources :app:mergeDebugResources 最新:app:processDebugManifest UP-TO-DATE :app:processDebugResources最新 :app:generateDebugSources 最新:app:preDebugAndroidTestBuild 最新:app:prepareDebugAndroidTestDependencies:app:compileDebugAndroidTestAidl 最新:app:processDebugAndroidTestManifest 最新:app:compileDebugAndroidTestRenderscript 最新:app:generateDebugAndroidTestBuildConfig 最新:app:generateDebugAndroidTestAssets 最新:app:mergeDebugAndroidTestAssets 最新:app:generateDebugAndroidTestResValues 最新:app:generateDebugAndroidTestResources 最新:app:mergeDebugAndroidTestResources 最新:app:processDebugAndroidTestResources 最新:app:generateDebugAndroidTestSources 最新:app:compileDebugJavaWithJavac 最新 :app:compileDebugNdk最新 :app:compileDebugSources 最新:app:transformClassesAndResourcesWithExtractJarsForDebug:app:transformClassesWithDexForDebug 意外的顶级异常:错误:任务执行失败':app:transformClassesWithDexForDebug'.com.android.build.transform.api.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理'命令'/usr/lib/jvm/java-7-oracle/bin/java'' 以非零退出结束值 2 信息:BUILD FAILED 信息:总时间:1 分钟 39.994秒信息:1 错误信息:0 警告信息:参见在控制台中完成输出
我的顶级gradle是
构建脚本{存储库{jcenter()}依赖{类路径 'com.android.tools.build:gradle:1.3.0'类路径 'com.google.gms:google-services:1.4.0-beta3'//注意:不要将您的应用程序依赖项放在这里;他们属于//在单独的模块 build.gradle 文件中}}所有项目{存储库{jcenter()}}我的应用级gradle是<预>应用插件:'com.android.application'应用插件:'com.google.gms.google-services'安卓 {compileSdkVersion 23buildToolsVersion '23.0.1'默认配置{applicationId "com.questo.rugved.questo"minSdk 版本 15目标SDK版本23版本代码 1版本名称1.0"}构建类型{发布 {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}依赖{编译文件树(目录:'libs',包括:['*.jar'])编译'com.android.support:appcompat-v7:23.0.1'编译'com.android.support:design:23.+'编译 'com.google.android.gms:play-services-identity:8.1.0'编译'com.google.android.gms:play-services-plus:8.1.0'}
请帮忙.
也许这个链接可以帮到你.链接
这对我有帮助:
android {...默认配置{...multiDexEnabled true}}
I'm trying to implement Google sign in for Android and I'm following the instructoins via
https://developers.google.com/identity/sign-in/android/start-integrating
But while building the application I'm receiving the following error.
My top level gradle is
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' classpath 'com.google.gms:google-services:1.4.0-beta3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } }
My app level gradle is
<pre>
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.questo.rugved.questo"
minSdkVersion 15
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'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.+'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-plus:8.1.0'
}
please help.
Maybe this link helps you. link
That helped me:
android {
...
defaultConfig {
...
multiDexEnabled true
}
}
这篇关于在为 Android 实现 Google 登录时,任务 ':app:transformClassesWithDexForDebug' 的执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!