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