Simple solutions for more than 65535 methods in Android development

Source: Internet
Author: User

Sometimes our project relies on many third-party module, and when the number of methods exceeds 65535, it will fail when packaged as an apk.

In this case, Google has provided a patch package to subcontract our project.

The first step:

Modify all the Build.gradle of the module that need to be packaged in the project.

  1 , add multidexenabled = True. such as:

defaultconfig {   ApplicationID "com.biketo.rabbit"    minsdkversion    targetsdkversion    E 956    versionname "0.9.5.6"    multidexenabled = True }  
2, add under the Android node:
dexoptions {   javamaxheapsize "2g"    Jumbomode = true}

Step Two:
To add a dependency package in the Build.gradle of the main module:
Compile ' com.android.support:multidex:1.0.0 '
Step Three:
Let our application inherit from Multidexapplication.
Fourth Step:
Rebuild project. OK, this will not be an error.

Simple solutions for more than 65535 methods in Android development

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