Search code examples
androidandroid-multidex

Facing Dex 65K methods limitation error


I'm getting this error in my app:

java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536

I know that is due to 65K methods limitation in a single dex file. So, I have put multiDexEnable true in my build.gradle. But now, I get this another error:

Execution failed for task ':app:transformClassesWithMultidexlistForSitraRelease'.

java.io.IOException: Can't read [C:\Program Files\adt-bundle-windows\build-tools\20.0.0\multidex\shrinkedAndroid.jar] (No such file or directory)

What can I do?

EDIT

I have added com.android.support:multidex:1.0.0 dependency and changed App extends Application to App extends MultiDexApplication and still not working.

Note: When I remove the dependency com.batch.android:batch-sdk:1.5+ everything work properly.


Solution

  • in your build.gradle file, update buildToolsVersion to be 21.1.0 or higher. (You are currently using 20.0.0)

    something like:

    android {
        compileSdkVersion 21
        buildToolsVersion "21.1.0"
    ...
    

    And also make certain your sdk manager is up to date.

    More info : http://developer.android.com/intl/es/tools/building/multidex.html#mdex-gradle