Android Learning Note----Resolution "Com.android.dex.DexIndexOverflowException:method ID not in [0, 0xFFFF]: 65536" issue

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 forTask ':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.DexIndexOverflowException:method ID not in [0, 0xFFFF]: 65536At 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.mergeMethodIds (Dexmerger.java:491) at Com.android.dx.merge.DexMerger.mergeDexes (Dexmerger.java:168) at Com.android.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:60W) at Com.android.dx.command.dexer.Main.run (Main.java:245) at Com.android.dx.command.dexer.Main.main (Main.java:214) at Com.android.dx.command.Main.main (Main.java:106)

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

Dependencies {...    ' Com.android.support:multidex: '    ...}

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

defaultconfig {    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

Android Learning Note----Resolution "Com.android.dex.DexIndexOverflowException:method ID not in [0, 0xFFFF]: 65536" issue

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.