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.

Codo
  • 75,595
  • 17
  • 168
  • 206
Leo Wiki
  • 252
  • 3
  • 17
  • Did you google three error message? – Code-Apprentice Sep 12 '16 at 07: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 – Shadow Droid Sep 12 '16 at 07:45
  • 2
    Possible duplicate of [dex loader unable to execute dex: method ID not in \[0, 0xffff\]: 65536](http://stackoverflow.com/questions/25928392/dex-loader-unable-to-execute-dex-method-id-not-in-0-0xffff-65536) – Code-Apprentice Sep 12 '16 at 07:47

4 Answers4

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.

Piyush
  • 18,895
  • 5
  • 32
  • 63
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.

Codo
  • 75,595
  • 17
  • 168
  • 206
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.

RoShan Shan
  • 2,924
  • 1
  • 18
  • 38
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".

Community
  • 1
  • 1
Leo Wiki
  • 252
  • 3
  • 17