安装错误:INSTALL_FAILED_DEXOPT

时间:2014-08-01 09:51:32

标签: android linux-kernel google-play-services android-install-apk dx

嗨,我有一个非常大的问题,我的应用程序大小约为10mb,我有7mb的junit(jar)文件。最近我更新了googleplayservice与我的应用程序添加后我的apk没有安装到api级别小于11.我在这里添加了我的日志猫。

08-01 15:09:25.333: E/dalvikvm(429): LinearAlloc exceeded capacity (5242880), last=100
08-01 15:09:25.333: E/dalvikvm(429): VM aborting
08-01 15:09:25.522: W/installd(34): DexInv: --- END '/data/app/com.xxxxxx.xxxx.android-1.apk' --- status=0x000b, process failed
08-01 15:09:25.522: E/installd(34): dexopt failed on '/data/dalvik-cache/data@app@com.xxxxx.xxxx.android-1.apk@classes.dex' res = 11

2 个答案:

答案 0 :(得分:1)

The issues is our method reaches 64k size.
Easy solution for this issues is we need to reduce our function or we need to remove few library which is not necessary.
Best solution is we can use  ant build to take apk. and create build.xml file to  split our library in to two files and we can inject that library in runtime.
We solved that issues buy using ant build.

Android studio中还有一个选项,他们引入了一个名为multi dex file的功能,所以使用它可以解决这个问题。

于06-04-2015编辑

当您更新谷歌播放服务时问题会上升所以不是添加整个播放服务安卓工作室提供了一种方法来为项目添加特定的api Reference它会减少你的方法

答案 1 :(得分:0)

这里也一样。我只能通过将谷歌播放服务降级到5089000来修复。

为什么会发生这种情况的真正原因是因为播放服务太大而且超出了编译方法的限制。

我不得不下载播放服务分开的jar并从那里编译它。

之所以发生这种情况,是因为如果您选择从那里下载lib,Google会在Android ADT中发布一个巨大的jar。在哪里,如果您从gradle下载,您可以选择并仅选择您实际使用的罐子。

由于我不使用gradle,我不得不创建一个假的gradle项目,以便能够下载我需要的那些游戏服务分离的jar。

非常凌乱。

相关问题