Solve the problem of "cannot merge new index 67208 into a non-jumbo instruction"

Source: Internet
Author: User

After upgrading ADT and SDK tool to the latest version (21.1 and 16.0.1 respectively), an error occurs during compilation and running of one of my projects (relatively large, the eclipse console outputs the following information:

Unable to execute DEX: cannot merge new index 67208 into a non-jumbo instruction!
Conversion to Dalvik format failed: unable to execute DEX: cannot merge new index 67208 into a non-jumbo instruction!

Many people will encounter this problem after upgrading ADT and SDK tool, but the numbers in the error message are different.

In addition, I also found a phenomenon: If you only compile but do not generate an APK, there will be no errors; in fact, from the preceding error message, we can see some clues-it is wrong when converting the JAR file to the DEX file.

The solution provided on the Internet is to add Dex. Force. Jumbo = true to the project. properties file, clean up the project, and re-compile it.

This method can solve the problem in the compilation phase, but the generated APK cannot be installed on some machines (installation error: install_failed_dexopt). One possible explanation for this problem is:

When the latest ADT and SDK tool convert jar to Dex, the code of the class may be merged, which leads to a huge class. Each method in the class is assigned an ID, in the bytecode, the ID is used to identify and call the method. In the early Dalvik Vm, the short type variable is used to identify the method ID. The maximum value is 65535. Based on the above factors, when the code is installed, the installation fails because the verification fails.

The latest Android version may have solved this problem, but earlier Android versions may still have this problem.

Therefore, due to the existence of a large number of legacy machines, this problem cannot be completely solved. A temporary solution is to delete codes that are not actually used, you can also use proguard to Process Code (which can reduce the size of the Code ).

Unfortunately, with the increase of a software function and the expansion of code, the APK package will eventually be out of the processing range, maybe 8 m (referring to the classes. Dex in the APK package ).

The two discussion groups related to this question are:

Https://code.google.com/p/android/issues/detail? Id = 40409

Https://groups.google.com/forum? Fromgroups = #! Topic/ADT-dev/tulxn9gkvas

Solve the problem of "cannot merge new index 67208 into a non-jumbo instruction"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.