首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >dx失败并返回RoboGuice

dx失败并返回RoboGuice
EN

Stack Overflow用户
提问于 2012-02-29 01:16:56
回答 2查看 968关注 0票数 1

我正在尝试打包一个使用RoboGuice的安卓应用程序。.class文件编译得很好,但是在构建Android包时,dx会失败,并显示"No expanded opcode“消息。

运行dx --dex --debug --verbose target/android-classes会产生以下结果:

代码语言:javascript
复制
trouble writing output:
com.android.dx.util.DexException: No expanded opcode for 6c80c7f5 Key.java:371@0003: invoke-virtual v0:[Lcom/google/inject/Key$NullAnnotationStrategy;, com.google.inject.Key$NullAnnotationStrategy[].clone:()Ljava/lang/Object;
at com.android.dx.dex.code.OutputFinisher.findExpandedOpcodeForInsn(OutputFinisher.java:526)
at com.android.dx.dex.code.OutputFinisher.calculateReservedCount(OutputFinisher.java:467)
at com.android.dx.dex.code.OutputFinisher.reserveRegisters(OutputFinisher.java:403)
at com.android.dx.dex.code.OutputFinisher.finishProcessingAndGetList(OutputFinisher.java:359)
at com.android.dx.dex.code.DalvCode.finishProcessingIfNecessary(DalvCode.java:108)
at com.android.dx.dex.code.DalvCode.getInsns(DalvCode.java:185)
at com.android.dx.dex.file.CodeItem.place0(CodeItem.java:223)
at com.android.dx.dex.file.OffsettedItem.place(OffsettedItem.java:242)
at com.android.dx.dex.file.MixedItemSection.placeItems(MixedItemSection.java:312)
at com.android.dx.dex.file.DexFile.toDex0(DexFile.java:543)
at com.android.dx.dex.file.DexFile.toDex(DexFile.java:216)
at com.android.dx.command.dexer.Main.writeDex(Main.java:574)
at com.android.dx.command.dexer.Main.run(Main.java:218)
at com.android.dx.command.dexer.Main.main(Main.java:174)
at com.android.dx.command.Main.main(Main.java:95)
...while placing CodeItem{com.google.inject.Key$NullAnnotationStrategy.values:()[Lcom/google/inject/Key$NullAnnotationStrategy;}
...while writing section 7

这发生在RoboGuice 1.1.2 (Guice 2)和RoboGuice 2.0b3 (Guice 3)中。

在谷歌中,我发现this previous question on Stack Overflow似乎是一个配置错误,但我不认为这是我遇到的问题……帮助!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-02-29 19:46:28

事实证明,这个问题与Dalvik的hard 64k method limit有关;我已经提交了一份new bug report,要求安卓团队修复诊断输出不佳的问题。

票数 0
EN

Stack Overflow用户

发布于 2012-04-05 12:12:35

你可以重写dx代码,让它支持扩展操作码。我希望我的答案能帮助你。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9486575

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档