执行失败的任务“:应用程序:dexDebug”当我加入谷歌云模块 [英] Execution failed for task ':app:dexDebug' when I add Google Cloud Module

查看:304
本文介绍了执行失败的任务“:应用程序:dexDebug”当我加入谷歌云模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

克隆项目 https://github.com/googlesamples/google -Services /树/主/安卓/ GCM ,一切完美的作品。

Clone the project https://github.com/googlesamples/google-services/tree/master/android/gcm and everything works perfectly.

当我尝试添加模块 App Engine的后端与谷歌云通讯使用向导我得到以下错误:

When I try to add the module "App Engine Backend with Google Cloud Messaging" with the wizard I get the following error:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.transform.api.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1

现在我试着在我的build.gradle defaultConfig添加此

Now I try to add this in my build.gradle defaultConfig

multiDexEnabled true 

和清理项目并重新编译。但是,我总是得到同样的错误。最后,我尝试从项目中删除的形式(思维来恢复正常工作),但我得到以下错误:

and clean the project and recompile. But I always get the same error. Finally I try to delete the form from the project (thinking to resume normal functioning) but I get the following error:

    Installing gcm.play.android.samples.com.gcmquickstart
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/gcm.play.android.samples.com.gcmquickstart"
    pkg: /data/local/tmp/gcm.play.android.samples.com.gcmquickstart
Failure [INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.example.gcm.permission.C2D_MESSAGE pkg=it.elipse.tnttrackingapp]


DEVICE SHELL COMMAND: pm uninstall gcm.play.android.samples.com.gcmquickstart
DELETE_FAILED_INTERNAL_ERROR

有人能帮助我吗?你走你发现自己相同的步骤,在我的处境?谢谢你在前进

Could someone help me? to you taking the same steps you find yourself in my situation? Thank you in advance

推荐答案

解决

家伙,您好我已经被自己找到了答案。我希望它可以是有益的人有同样的问题。
当Android的Studio生成的后端模块,在你的build.gradle的依赖的末尾添加这一行(模块:应用程序)

Hi guys i've found by myself the answer. I hope that it can be helpfull for someone with the same problem. When Android Studio generates the backend module, adds this line at the end of dependencies of your build.gradle(Module:app)

compile project(path: ':backend', configuration: 'android-endpoints')

和你有这样的事情:

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.1.0'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:palette-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile project(path: ':backend', configuration: 'android-endpoints')

}

解决办法是将自动生成行依赖条件声明的顶部,这样的:

The workaround is to move the auto-generated line on the top of dependecies declaration, like this:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile project(path: ':backend', configuration: 'android-endpoints')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:palette-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'  
compile 'com.android.support:support-v4:23.0.1'  
compile 'com.google.android.gms:play-services-gcm:8.1.0'

}

更新

如果你不解决尝试:

Build->Make Project
Build->Make Module 'app'
Build->Clean Project
Build->Rebuild Project

这篇关于执行失败的任务“:应用程序:dexDebug”当我加入谷歌云模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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