eclipse 无法“构建工作区”在大型 Android 文件上...?
我有一个严重的 Eclipse 问题,我需要编译一个更大的类。我所说的“更大”是指,该类大约有 5000 行代码...
问题是,在保存该项目时,Eclipse 需要几秒钟(30-40)来“构建工作区”。准确地说,它显示“50%”,并持续显示 30-40 秒。然后,它会因以下错误而中断:
[console]:
[2010-07-09 15:28:39 - Dex Loader] 无法执行 dex: null
[2010-07-09 15:28:39 - myProject] 转换为 Dalvik 格式失败:无法执行 dex: null
[问题窗口]:
转换为 Dalvik 格式失败:无法执行 dex: null
此错误是可重现的,并且不断弹出,直到我注释掉数千个 LOC,以便该文件仍然具有这 5k LOC,但其中大约 2000 个是注释。然后它就起作用了...
我知道 5000 LOC 并不是真正好的编程风格,但我现在需要这样做...(我必须将这么多记录写入 sqlite 数据库,因为 sqlite 不具有多个 sql - 在一个 rawQuery 命令中的查询,我必须为我需要推入数据库的每一个数据记录执行一个 rawQuery() ... - 直到我编写一个文件读取器来从文件中读取此数据(需要验证等)),我坚持这个解决方案...)
我如何让 Eclipse 和 android sdk 接受这么大的文件?
(系统:ubuntu 10.04 x86,eclipse 3.6)
i have a severe problem with eclipse, where i need to compile a somewhat larger class. by "larger" i mean, the class has about 5000 lines of code...
problem is that on saving this project, eclipse takes several seconds (30-40) to "build the workspace". to be exact, it says "50%" and keeps saying that for 30-40 seconds. then, it breaks with the following error:
[console]:
[2010-07-09 15:28:39 - Dex Loader] Unable to execute dex: null
[2010-07-09 15:28:39 - myProject] Conversion to Dalvik format failed: Unable to execute dex: null
[problems window]:
Conversion to Dalvik format failed: Unable to execute dex: null
this error is reproducible and keeps popping up until i comment out several thousands LOC, so that the file still has this 5k LOC, but ~2000 of them are comments. THEN it works...
i know that 5000 LOC are no really good programming style, but i need to do it this way for now ... (i have to write this much records to a sqlite database and since sqlite doesnt feature multiple sql-queries in one rawQuery-command i have to execute a single rawQuery() for each and every data record i need to push into the db.... - until i write a file reader to read this data from a file (that needs verification etc)), i'm stuck with this solution...)
how do i get eclipse and the android sdk to accept files this big?
(system: ubuntu 10.04 x86, eclipse 3.6)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信在 Dalvik 中类的字节码大小不得超过 64k。你必须把班级分成更小的班级。
I believe the size of a class's bytecode must not exceed 64k in Dalvik. You'll have to split the class into smaller ones.