1

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

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
4

2 回答 2

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 中还有一个选项可用,他们引入了一个称为多个 dex 文件的功能,因此我们可以解决这个问题。

2015 年 6 月 4 日编辑

当你更新你的谷歌播放服务时问题会出现所以而不是添加整个播放服务android工作室提供了一种将特定api添加到项目参考的方法它会减少你的方法

于 2014-09-26T04:51:31.440 回答
0

和这里一样。我只能通过将 google play 服务降级到 5089000 来修复。

对我来说发生这种情况的真正原因是因为播放服务太大并且超出了编译方法的限制。

我必须下载播放服务分离的 jars 并从那里编译它。

发生这种情况的原因是,如果您选择从那里下载 lib,谷歌现在会在 Android ADT 中提供一个巨大的 jar。在哪里,如果您从 gradle 下载,您可以只选择您实际使用的 jar。

由于我不使用 gradle,我必须创建一个假的 gradle 项目才能下载我需要的那些播放服务分离的 jar。

很乱。

于 2015-04-02T00:01:16.180 回答