Android Error in Eclipse: “Unable to execute dex:

2019-01-10 21:51发布

I am trying an Android project using OpenSAML using Eclipse. I have added all the required jar files in the build path. Now, when I run the program as an Android Application the following error shows up:

[2012-11-18 11:52:59 - Dex Loader] Unable to execute dex: Cannot merge new index 67075 into a non-jumbo instruction!
[2012-11-18 11:52:59 - MyTestProgram] Conversion to Dalvik format failed: Unable to execute dex: Cannot merge new index 67075 into a non-jumbo instruction!

I googled a bit, but nothing came up. What could this error mean?

7条回答
smile是对你的礼貌
2楼-- · 2019-01-10 22:41

Just adding jumboMode=true didn't work for my gradle build. However this worked (quoted from Xavier in the adt-dev group as a reply to a bug filed in this area):

"Try to delete all the build folders manually and build again, making sure the dexOptions.jumboMode is set to true in the project?

There's an issue where the root project's build is not deleted in the clean task and this contains some information about the pre-dexed libraries."

查看更多
相关推荐>>
3楼-- · 2019-01-10 22:44

One solution that I found that got it working for me was to add dex.force.jumbo=true to my project.properties.

This was pointed out at: https://groups.google.com/forum/?fromgroups=#!topic/adt-dev/tuLXN9GkVas

This is assuming you are running ADT 21 as this feature wasn't available in previous versions.

查看更多
Juvenile、少年°
4楼-- · 2019-01-10 22:46

I had the same problem, but in my case the "dex.force.jumbo=true" command doesn't solve the problem. I try to update JDK and JRE , and that solve the problem.

Hope this answer help

查看更多
爷的心禁止访问
5楼-- · 2019-01-10 22:49

The same problem...just put

dex.force.jumbo=true

in the first line of project.properties

查看更多
虎瘦雄心在
6楼-- · 2019-01-10 22:49

Adding some explanation:

This happens when Eclipse tries to incrementally build, when a change increases the number of string constants in the application. The original dex had non-jumbo instructions, and the new dex that's being merged into it has jumbo instructions. Doing a clean will show that it works when you build from scratch.

As long as the number of strings in your application is monotonically increasing, incremental builds will work going forward.

查看更多
姐就是有狂的资本
7楼-- · 2019-01-10 22:51

I had the same problem, but my IDE was IntelliJ IDEA 13. In that version, the dex.force.jumbo instruction in the project.properties file is ignored.

To enable it, just go to Settings | Compiler | Android DX and select the Force jumbo mode option.

Hope it helps (this is the only SO-related question I have been able to find).

查看更多
登录 后发表回答