0

I'm using Eclipse, 3 days ago I added API-23 to my Eclipse (Previously it was API-22) to implement some functionality. But after adding API-23 I'm getting the following error in console--

[2016-09-12 12:47:06 - MyApp] Dx trouble writing output: already prepared [2016-09-12 12:47:41 - Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536 [2016-09-12 12:47:41 - MyApp] Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536 

For more details please see the below screen-shots-

enter image description here

enter image description here

Since 3 days I badly stuck on this issue, so any help is really very appreciated. Thank you.

3
  • Did you google three error message? Commented Sep 12, 2016 at 7:44
  • Please either enable multidex feature for your project or switch your project to Android Studio. In Android Studio your include only those libraries which you need and if still problem exist you can enalbe multidex feature Commented Sep 12, 2016 at 7:45
  • 2
    Possible duplicate of dex loader unable to execute dex: method ID not in [0, 0xffff]: 65536 Commented Sep 12, 2016 at 7:47

4 Answers 4

2

This error occurs because the limitation of 65K method exceeds.

You need to check that how many libraries or .jar files you have added in your project.

This error mostly occurs because of your google-play-services libs project. Because now a days it is providing different types of dependencies for Android Studio.

Solution:

To overcome with this whenever you run your project you need to un-check these both options

Android Private Libraries and Android Dependency

After clean your project and run it.

Sign up to request clarification or add additional context in comments.

Comments

1

You have exceeded the Android limit of 64K methods. If you were close to the limit, upgrading to newer libraries or a newer API can push you over the limit.

Please follow the official instructions of how to configure your app to build with more than 64K methods.

Comments

1

I had this issues when I imported a lot of libraries using Eclipse. I worked around by remove unused libraries and using proguard when buiding. I searched and found libraries support for eclipse

https://github.com/mmin18/Dex65536

You can try it.

But I think you need to change to Android Studio, it will solve your problems absolutely.

Comments

0
I just found an alternative to solve this issue on Eclipse when using Google Play Services. Because on Eclipse it seems that there is no way to use multidex as in Android Studio (and Gradle) this seems the only way to work on Eclipse rigth now. 1] go in the google-play-service-lib project 2] go in libs 3] unzip the file google-play-services.jar 4] go in the the unzipped folder and remove all folders that you don't need (i.e. if you need Analytics, you can remove ads, games, maps, wallet, drive, etc.) 5]zip again such a folder (that now contains only the needed libraries) together with the MANIFEST folder 6]use such new jar with your project. 

I got the answer at this link. See the answer given by "Ugo Chirico".

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.