ADT:当包装和类太多时,无法构建 [英] ADT: fail to build when there are too many packages and classes

查看:114
本文介绍了ADT:当包装和类太多时,无法构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在Eclipse(v4.2)中使用ADT(r20),我有一个大型项目,许多图书馆项目以及许多包和类。建立,我得到这个错误:


[2012-07-08 09:05:33 - AndroidUIPatterns] Dx故障写入输出:
太多字段:69379;最大为65536.通过包:

  19 android.app 
14 android.content.pm
5 android.content.res
2 android.gesture
39 android.graphics
8 android.graphics.drawable
13 android.os
3 android.provider

...

...

[2012-07 -08 09:05:33 - AndroidUIPatterns]转换为Dalvik格式失败,错误2


对于完整的错误日志,您可以看到它这里: http://pastie.org/4218297



Android项目中的包/类似乎有最大限制吗?



如果有人能告诉我如何解决这个问题,我将非常感谢您的帮助

解决方案

这是dx编译器的限制,目前仅限于65536(2 ^ 16)字段/方法引用每个dex 。自2010年以来,它是固定的。



现在唯一的解决方案是将应用程序分解成多个dex文件,所以没有一个dex文件超过64k的限制。

I have a big project with many library projects as well as many packages and classes in source code.

Using ADT (r20) in Eclipse (v4.2) to build, I get this error:

[2012-07-08 09:05:33 - AndroidUIPatterns] Dx trouble writing output: Too many fields: 69379; max is 65536. By package:

19 android.app
14 android.content.pm
 5 android.content.res
 2 android.gesture
39 android.graphics
 8 android.graphics.drawable
13 android.os
 3 android.provider

...
...
[2012-07-08 09:05:33 - AndroidUIPatterns] Conversion to Dalvik format failed with error 2

For full error log, your can see it here: http://pastie.org/4218297

It seems there is a maximum limit for number of package / class in an Android project?

I'll appreciate all your help if anyone can tell me how to solve this error.

解决方案

It's a limitation of dx compiler that is currently limited to 65536 (2^16) field/method references per dex. It's "being fixed" since 2010.

The only solution now is to split application into multiple dex files, so no single dex file exceeds the 64k limit.

这篇关于ADT:当包装和类太多时,无法构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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