android - Unable to execute dex: method ID not in [0, 0xffff]: 65536 -
android - Unable to execute dex: method ID not in [0, 0xffff]: 65536 -
i have seen various versions of dex erros before, 1 new. clean/restart etc won't help. library projects seems intact , dependency seems linked correctly.
unable execute dex: method id not in [0, 0xffff]: 65536 conversion dalvik format failed: unable execute dex: method id not in [0, 0xffff]: 65536 or
cannot merge new index 65950 non-jumbo instruction tl;dr: official solution google here!
http://developer.android.com/tools/building/multidex.html
only 1 little tip, need prevent out of memory when doing dex-ing.
dexoptions { javamaxheapsize "4g" } there's jumbo mode can prepare in less reliable way:
dexoptions { jumbomode true }
update 3 (11/3/2014) google released official description.
update 2 (10/31/2014) gradle plugin v0.14.0 android adds support multi-dex. enable, have declare in build.gradle:
android { defaultconfig { ... multidexenabled = true } } if application supports android prior 5.0 (that is, if minsdkversion 20 or below) have dynamically patch application classloader, able load classes secondary dexes. fortunately, there's library you. add together app's dependencies:
dependencies { ... compile 'com.android.support:multidex:1.0.0' } you need phone call classloader patch code possible. multidexapplication class's documentation suggests 3 ways (pick one of them, 1 that's convenient you):
1 - declare multidexapplication class application in androidmanifest.xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.multidex.myapplication"> <application ... android:name="android.support.multidex.multidexapplication"> ... </application> </manifest> 2 - have application class extend multidexapplication class:
public class myapplication extends multidexapplication { .. } 3 - phone call multidex#install application#attachbasecontext method:
public class myapplication { protected void attachbasecontext(context base) { super.attachbasecontext(base); multidex.install(this); .... } .... } update 1 (10/17/2014): anticipated, multidex support shipped in revision 21 of android back upwards library. can find android-support-multidex.jar in /sdk/extras/android/support/multidex/library/libs folder.
multi-dex back upwards solves problem. dx 1.8 allows generating several dex files. android l back upwards multi-dex natively, , next revision of back upwards library going cover older releases api 4.
it stated in this android developers backstage podcast episode anwar ghuloum. i've posted transcript (and general multi-dex explanation) of relevant part.
android dex
Comments
Post a Comment