Reputation: 131
I am developing an application in which app I am using too many libraries. Most recently I added mixpanel lib to my project. After that the build was successful. But when I try to run the app I am getting an error:
[2015-11-06 15:04:54 - Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536 [2015-11-06 15:04:54 -] Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536
I have read so many articles. But I have not implemented in eclipse. Even if I add multidex jar to my app and extend my application class to mulidexapplication, I get the same error. Please any one help me.
Upvotes: 0
Views: 1240
Reputation: 292
since you project has more than 64K methods you it gives you the error.
Add the following statement your project build.gradle
file will solve the issue it gives the error but it will execute no problem
compile 'com.android.support:multidex:1.0.1'
defaultConfig {
minSdkVersion 11
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
Please go through the link
Upvotes: 0
Reputation: 5534
Working with too many libraries always cause this problem.
make sure you are not importing same library twice.
For Example,
You are using library let's say XYZ which imports AppCompat library. now you are importing this library to your main project which is also importing AppCompat library.
Now this AppCompat library has been imported twice in your project. so this may gives you error of multiDex
.
so you can remove AppCompact From your main project.
then clean and run. will work fine.
hope this will helps you.
Upvotes: 3
Reputation: 7209
You should move your code to Android Studio and when your gradle file is build successfully then enter this line in your gradle file
defaultConfig {
multiDexEnabled true
}
Upvotes: 1