Dexopt failed on a very big APK (Out-of-order method_idx) when dex.force.jumbo=true

混江龙づ霸主 提交于 2019-12-04 02:46:00
Gili Nachum

The 64K methods limit is a Dex format limitation (it uses 2 bytes to lookup a method).
Nandeesh comment's points out that jumbo solves string only, not methods.

Alternatives I tried/considered (brace yourselves, they all suck):
1. Do It Yourself - Throw away the fattest 3rd party libraries and write the exact parts of its functionality yourself. This is the approach I ended up taking, as I realized I'm including a lot of code for a small functionality.
2. Custom class loading in Dalvik - Compile a separate Dex and load it on runtime. Cons: cumbersome, requires reflection.
3. Code Pruning - Turn on verbose class loading, run the app and try to remove 3rd party libraries, or parts of the library that are not really used. Cons: time consuming, error prone as classes are dynamically loaded.
4. Divide And Concur - Package 3rd party libraries in a separate process (a service). This service will provide the 3rd party libraries functionality. Perform calls on this service from your main program.

I believe that it's a case of 640k ought to be enough for anybody OR No way will have this on every 2nd phone in the planet on the part of Dalvik's early design team.

If you want to read more or simply cry out load to Google, I've created this defect: http://code.google.com/p/android/issues/detail?id=40409

I encountered same problem. finally I found it may caused by multiple methods in same name, for example, doSomething(List list); and doSomething(List list); compiler says no errors, but it can't install to my device. So please check your methods with same name.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!