com.android.build.transform.api.TransformException [英] com.android.build.transform.api.TransformException

查看:25
本文介绍了com.android.build.transform.api.TransformException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试集成 Google 登录,在我的应用中,我添加了这些库:

I am trying to integrate Google sign in, in my app, I added these libraries:

compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-plus:8.1.0'

还要将此添加到项目构建 gradle 中:

Also add this to project build gradle:

classpath 'com.google.gms:google-services:1.4.0-beta3'

还要将插件添加到应用构建 gradle:

Also add plugin to app build gradle:

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

然后添加所需的权限但是当我尝试运行我的应用程序时,收到此错误:

then add required permissions but when I try to run my app, received this error:

    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 'C:Program FilesJavajdk1.8.0injava.exe'' finished with non-zero exit value 2

推荐答案

尝试将 multiDexEnabled true 添加到您的应用 build.gradle 文件中.

Try adding multiDexEnabled true to your app build.gradle file.

 defaultConfig {
    multiDexEnabled true
}

首先尝试史蒂夫的答案.如果它经常发生或第一步没有帮助 multiDexEnabled 可能会有所帮助.对于那些喜欢深入挖掘的人来说,这里有几个类似的问题(有更多答案):

Try Steve's answer first. In case it happens frequently or first step didn't help multiDexEnabled might help. For those who love to dig deeper here is couple similar issues (with more answers):

:app:dexDebug ExecException 以非零退出值 2 结束

错误:任务:app:dexDebug"执行失败.com.android.ide.common.process.ProcessException

这篇关于com.android.build.transform.api.TransformException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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