“java.exe"退出代码 2 [英] "java.exe" exited with code 2

查看:37
本文介绍了“java.exe"退出代码 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 Google Play 服务添加到我的地图项目中,但现在不断出现此错误java.exe"并以代码 2 退出.我不确定它是否与以代码 1 退出的java.exe"不同,但我已经尝试了所有在线建议我的堆大小是 1G.我的目标版本是 21,我有干净的重建等.当我单击错误时,它会将我带到这个 CompileToDalvik.我该如何解决这个问题?即使我删除了 google play 服务,我仍然会收到此错误(清理/刷新重建等.)

I added Google play services to my project for maps but now keep getting this error "java.exe" exited with code 2. I am not sure if it is different from "java.exe" exited with code 1 but I have tried all the suggestions online My heap size is 1G. My target version is 21, I have clean rebuild etc.. When I click on the error it takes me to this CompileToDalvik. How can I resolve this? Even if I remove google play services I still get this error( clean / refresh rebuild etc..)

推荐答案

我们遇到了类似的问题,并将其归结为我们的应用程序超过 64k (65,536) 个方法限制,这可能是您引用 google play 服务时发生的情况.

We had similar issues and nailed it down to our app going over 64k (65,536) methods limit which could be what's happening when you reference google play services.

启用 multidex 解决了我们的问题,因此值得一试.

Enabling multidex resolved our issue so may be worth trying.

Google Multi-Dex 参考:http://developer.android.com/tools/building/multidex.html

Google Multi-Dex Reference: http://developer.android.com/tools/building/multidex.html

这篇关于“java.exe"退出代码 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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