为 Android 实现 Google 登录时任务“:app:transformClassesWithDexForDebug"执行失败 [英] Execution failed for task ':app:transformClassesWithDexForDebug' while implementing Google sign in for Android

查看:25
本文介绍了为 Android 实现 Google 登录时任务“:app:transformClassesWithDexForDebug"执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 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 UP-TO-DATE:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE:app:prepareComAndroidSupportDesign2301Library UP-TO-DATE:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE:app:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE:app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library最新:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library最新:app:prepareComGoogleAndroidGmsPlayServicesBase810Library最新:app:prepareComGoogleAndroidGmsPlayServicesBasement810Library最新:app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library最新:app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library最新:app:prepareComGoogleAndroidGmsPlayServicesPlus810Library最新:app:prepareDebugDependencies:app:compileDebugAidl最新:app:compileDebugRenderscript 最新:app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets最新:app:mergeDebugAssets 最新:app:generateDebugResValues UP-TO-DATE :app:processDebugGoogleServices找不到与包名称com.questo.rugved.questo"匹配的客户端:app:generateDebugResources :app:mergeDebugResources 最新:app:processDebugManifest 最新 :app:processDebugResources最新:app:generateDebugSources 最新:app:preDebugAndroidTestBuild UP-TO-DATE:app:prepareDebugAndroidTestDependencies:app:compileDebugAndroidTestAidl 最新:app:processDebugAndroidTestManifest 最新:app:compileDebugAndroidTestRenderscript UP-TO-DATE:app:generateDebugAndroidTestBuildConfig UP-TO-DATE:app:generateDebugAndroidTestAssets UP-TO-DATE:app:mergeDebugAndroidTestAssets 最新:app:generateDebugAndroidTestResValues UP-TO-DATE:app:generateDebugAndroidTestResources UP-TO-DATE: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 警告信息:见在控制台完成输出

我的顶级毕业生是

<上一页>构建脚本 {存储库{中心()}依赖{类路径'com.android.tools.build:gradle:1.3.0'类路径 'com.google.gms:google-services:1.4.0-beta3'//注意:不要将您的应用程序依赖项放在这里;他们属于//在单个模块 build.gradle 文件中}}所有项目{存储库{中心()}}

我的应用级别 gradle 是<预>应用插件:'com.android.application'应用插件:'com.google.gms.google-services'安卓 {compileSdkVersion 23buildToolsVersion '23.0.1'默认配置 {applicationId "com.questo.rugved.questo"minSdkVersion 15targetSdkVersion 23版本代码 1版本名称1.0"}构建类型 {发布 {缩小启用假proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}依赖{编译 fileTree(dir: 'libs', include: ['*.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 真}}

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.

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug] :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE :app:prepareComAndroidSupportDesign2301Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus810Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:processDebugGoogleServices No matching client found for package name 'com.questo.rugved.questo' :app:generateDebugResources :app:mergeDebugResources UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources UP-TO-DATE :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl UP-TO-DATE :app:processDebugAndroidTestManifest UP-TO-DATE :app:compileDebugAndroidTestRenderscript UP-TO-DATE :app:generateDebugAndroidTestBuildConfig UP-TO-DATE :app:generateDebugAndroidTestAssets UP-TO-DATE :app:mergeDebugAndroidTestAssets UP-TO-DATE :app:generateDebugAndroidTestResValues UP-TO-DATE :app:generateDebugAndroidTestResources UP-TO-DATE :app:mergeDebugAndroidTestResources UP-TO-DATE :app:processDebugAndroidTestResources UP-TO-DATE :app:generateDebugAndroidTestSources UP-TO-DATE :app:compileDebugJavaWithJavac UP-TO-DATE :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources UP-TO-DATE :app:transformClassesAndResourcesWithExtractJarsForDebug :app:transformClassesWithDexForDebug UNEXPECTED TOP-LEVEL EXCEPTION: Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 2 Information:BUILD FAILED Information:Total time: 1 mins 39.994 secs Information:1 error Information:0 warnings Information:See complete output in console

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"执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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