Android Contemporary code method more than 65,536, on the 2.3 machine will not be installed, there is install_failed_dexopt error

Source: Internet
Author: User

Today, when packing, found 2.3 machines, the resulting apk on some machines can not be installed (Installation error: install_failed_dexopt), a possible explanation for this problem is: The latest ADT and SDK The tool may merge the code of the class when it turns the jar into Dex, which will result in a huge class, each method in the class is assigned an ID, and the method is identified and called by ID in the bytecode, and the early Dalvik VM uses the short type variable to identify the ID of the method. The maximum value is limited to 65535, and the code is not validated during installation, so the installation fails.

Our project because of the introduction of too many open-source libraries in the code, so the number of methods too many, and finally can only streamline the code, delete the unnecessary library to solve the problem.
The latest Android has solved this problem, but the earlier version of Android may still exist.
Therefore, due to the existence of a large number of legacy machines, this problem is not completely solved, a temporary solution is: Delete the code is not actually used, or use Proguard processing code (can reduce the code volume).
One unfortunate corollary: with the addition of a software function, the expansion of the code, the APK package will eventually go beyond the scope of processing, perhaps 8M (refers to the APK package inside the Classes.dex).
The two discussion groups that are related to this issue are:

At present, the 2.3 version of the market only 20%, I hope this share quickly decline it!

Android Contemporary code method more than 65,536, on the 2.3 machine will not be installed, there is install_failed_dexopt error

Related Article

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: 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.