eclipse 无法“构建工作区”在大型 Android 文件上...?

发布于 2024-09-09 15:55:02 字数 777 浏览 5 评论 0原文

我有一个严重的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

流殇 2024-09-16 15:55:02

我相信在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文