Fix "Com.android.dex.DexIndexOverflowException:method ID not in [0, 0xFFFF]: 65536" problem (L-turn)

Source: Internet
Author: User

A number of third-party jar packages were introduced into the project, resulting in more than 65,536 calls (Dex 64K problem), which led to Dex's inability to generate the apk file.

The solution is as follows:

1, the official Google has given the relevant documents, referring to the online search information, first of all, my question is:

Error:execution failed for task ':d uchazhushou:dexrelease ' .> Com.android.ide.common.internal.LoggedErrorException:Failed to run command:c:\users\jeff\appdata\local\android\ Sdk\android-sdk\build-tools\21.1.1\dx.bat--dex--output D:\dev\android\Duchazhushou_TDT\duchazhushou\build\ Intermediates\dex\release--input-list=d:\dev\android\duchazhushou_tdt\duchazhushou\build\intermediates\tmp\dex \release\inputlist.txterror code:2output:unexpected top-level EXCEPTION:com.android.dex.DexIndexOverflowExcept        Ion:method ID not in [0, 0xFFFF]: 65536 at Com.android.dx.merge.dexmerger$6.updateindex (dexmerger.java:502) At com.android.dx.merge.dexmerger$idmerger.mergesorted (dexmerger.java:277) at Com.android.dx.merge.DexMerger.merg Emethodids (dexmerger.java:491) at Com.android.dx.merge.DexMerger.mergeDexes (dexmerger.java:168) at Com.andro Id.dx.merge.DexMerger.merge (dexmerger.java:189) at Com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(main.java:454) at Com.android.dx.command.dexer.Main.runMonoDex (main.java:302) at Com.android.dx.command.dex Er. Main.run (main.java:245) at Com.android.dx.command.dexer.Main.main (main.java:214) at COM.ANDROID.DX.COMMAND.M Ain.main (main.java:106)

2. Add the sub-package settings in the Dependencies section of the project's Build.gradle file:

dependencies {...    Compile ' com.android.support:multidex: '    ...}

3. Turn on multi-dexing support by setting the multidexenabled tag to true in the Defaultconfig section.

Defaultconfig {    ... multidexenabled true ...}

4, in three kinds of situations, because I did not create their own application.class, directly in the Androidmanifest.xml file application declaration added;

Android:name= "Android.support.multidex.MultiDexApplication"

5, re-build, generate signature apk, install and use normal.

The above steps refer to the following link operation, the other two cases of the 4th step, in the following links are described in detail:

Http://stackoverflow.com/questions/27377080/after-update-of-as-to-1-0-getting-method-id-not-in-0-0xffff-65536-error-i

Fix "Com.android.dex.DexIndexOverflowException:method ID not in [0, 0xFFFF]: 65536" problem (L-turn)

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.