Saturday, October 27, 2018

java - Android - MultiDex Install




I have exceeded the 65k method limit, by importing an external library. I have enabled ProGuard, but still get the same error.



[2015-01-12 15:13:39 - Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536
[2015-01-12 15:13:39 - MyFirstGame] Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536


After reading the official Google documentation, it seems I should configure a MultiDex support. I am building my project using the Eclipse Indigo IDE, and do not have a build.gradle file. Using the SDK Manager I have installed 'Android Support Repository' Rev. 11 and 'Android Support Library' Rev. 21.0.3. I have added the



android:name="android.support.multidex.MultiDexApplication"



attribute to my manifest file, and am now trying to implement



@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(newBase);
MultiDex.install(this);
}



However, the 'MultiDex' class cannot be resolved. According to the Official Google Documentation, this jar should be located /extras/android/support/multidex/ There is no /multidex/ directory under the /support/ directory.



How might I download and install the MulitDex Support Library?


Answer




Using the SDK Manager I have installed 'Android Support Repository' Rev. 11




That is for developers using Android Studio or other tools that use Gradle for Android. Its contents will not be presently used by standard Eclipse.





According to the Official Google Documentation, this jar should be located /extras/android/support/multidex/




Try one of these:




  1. Follow the instructions for adding a support library with resources, using /extras/android/support/multidex/library/


  2. Copy the /extras/android/support/multidex/library/libs/android-support-multidex.jar JAR into your project's libs/ directory (since the aforementioned Android library project seems to only contain this JAR and nothing else)





Do not do both. Do one or the other.



UPDATE



Here is a screenshot of my /extras/android/support/, showing multidex/ right where the docs say it should be:



Android Support Package Directory Structure


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...