0

What's the solution for 65k ? I tried almost all the post but still not able to . Working on Android Studio but it is not letting me enable multidex option . Anyone having idea about it?

Any idea how to integrate with eclipse?

Sumit T
  • 1,273
  • 2
  • 17
  • 32

3 Answers3

3

For Android Studio and Gradle the answer is here: https://developer.android.com/tools/building/multidex.html#mdex-gradle

In Eclipse import the MultiDex library project from this location:

[android-sdk]\extras\android\support\multidex\library

Next you have three options:

Option 1

In your AndroidManifest.xml file update your <application> element like so:

<application
    name="android.support.multidex.MultiDexApplication">
    ...
</application>

Option 2

If you use custom Application class make sure you extend MultiDexApplication.

MyApplication.java

public class MyApplication extends MultiDexApplication {
    ...
}

AndroidManifest.xml

<application
    name=".MyApplication">
    ...
</application>

Option 3

If your application class cannot extend MultiDexApplication for some reason override the following method:

MyApplication.java

public class MyApplication extends Application {
    ...
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}

AndroidManifest.xml

<application
    name=".MyApplication">
    ...
</application>

Source: https://developer.android.com/reference/android/support/multidex/MultiDexApplication.html

Warning: Eclipse build tools do not support multidex. Look here for further info: Android multidex support library using eclipse

Community
  • 1
  • 1
Eugen Pechanec
  • 37,669
  • 7
  • 103
  • 124
  • Eugen , I tried this link, I am able to Implement the "multidexEnabled ture" into my build.gradle file , but where I need to place MultiDexApplication file ? And what is in Multidex.install funcation ? – Sumit T Nov 26 '14 at 00:37
  • You do not need to put the `MultiDexApplication` file anywhere, it's in the library. You just need to add the `android:name="android.support.multidex.MultiDexApplication"` to your `` element in `AndroidManifest.xml` and that's it. Note: If you already have some other application class name specified, have that class extend `MultiDexApplication` instead of `Application`. – Eugen Pechanec Nov 26 '14 at 01:19
  • This part helped me: " If you use custom Application class make sure you extend MultiDexApplication." – MikeOx Jul 28 '16 at 09:06
0

I did this tut and worked http://android-developers.blogspot.com.es/2011/07/custom-class-loading-in-dalvik.html

I have now rhino.jar in a dex file in my asset folder

eduyayo
  • 2,020
  • 2
  • 15
  • 35
  • Are you using eclipse or android studio ? – Sumit T Nov 26 '14 at 00:22
  • Have you tried creating dex file with multiple jars? With custom class loading you can only have one library at your dex file ? and again how can you use the functions ? (if with java reflection then you will be getting issues while initializing / accessing private fields). – Sumit T Nov 26 '14 at 00:32
  • I've gotta maven script creating a dex file with several jars. I explode the dependencies and build the dex from there. The build crashes always but te file is created and works and i've got a fixed set of libraries to move in there so I don't have to run that all day long and my app is built with the eclipse tools not with maven – eduyayo Nov 26 '14 at 12:34
0

This problem is solved with Android studio 1.0 and above. We need to set multidexEnabled parameter to true. That's all we need to implement. So, if anyone what to solve this problem you need to go with android studio.

Sumit T
  • 1,273
  • 2
  • 17
  • 32