47

我正在尝试使用 Eclipse 使用 OpenSAML 的 Android 项目。我已经在构建路径中添加了所有必需的 jar 文件。现在,当我将程序作为 Android 应用程序运行时,会出现以下错误:

[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!

我用谷歌搜索了一下,但没有任何结果。这个错误可能意味着什么?

4

7 回答 7

54

我发现它对我有用的一种解决方案是添加dex.force.jumbo=true到我的project.properties.

有人指出:https ://groups.google.com/forum/?fromgroups=#!topic/adt-dev/tuLXN9GkVas

这是假设您正在运行 ADT 21,因为此功能在以前的版本中不可用。

于 2012-11-19T16:31:52.473 回答
14

同样的问题......只是把

dex.force.jumbo=true

在 project.properties 的第一行

于 2013-06-26T09:39:12.877 回答
13

如果使用 gradle build,只需将 dexOptions 添加到 build.gradle 即可启用 jumbo 模式:

android {
    dexOptions {
        jumboMode = true
    }
}

记得在你的新建筑之前运行“gradle clean”。

于 2015-03-21T01:40:08.793 回答
6

我遇到了同样的问题,但我的 IDE 是 IntelliJ IDEA 13。在那个版本dex.force.jumbo中,文件中的指令project.properties被忽略了。

要启用它,只需转到设置 | 编译器 | Android DX并选择Force jumbo 模式选项。

希望它有所帮助(这是我能找到的唯一与 SO 相关的问题)。

于 2014-02-03T08:58:11.437 回答
5

只是添加jumboMode=true对我的 gradle 构建不起作用。然而,这很有效(引用自 adt-dev 组中的 Xavier 作为对该区域中提交的错误的回复):

“尝试手动删除所有构建文件夹并再次构建,确保项目中的 dexOptions.jumboMode 设置为 true?

存在一个问题,即根项目的构建没有在 clean 任务中删除,其中包含有关预索引库的一些信息。”

于 2015-01-26T16:00:41.270 回答
2

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.

于 2014-05-21T15:59:17.133 回答
0

我遇到了同样的问题,但在我的情况下,“dex.force.jumbo=true”命令并不能解决问题。我尝试更新 JDK 和 JRE ,这解决了问题。

希望这个答案有帮助

于 2014-12-18T07:02:16.743 回答