8

I am trying to build Multidex apk in eclipse, and not able to succeed.

I tried following steps, for configuring Multidex support in android app:

  1. I have added the Multidex library located at /extras/android/support/multidex/ to my project.
  2. As my app is having custom application class, I have extended android.support.multidex.MultiDexApplication Class to my application.

Still i am not able to build apk.

Android developer is also not having any documentation for building Multidex apk in eclipse, its only having documentation for gradle and Android Studio.

MLProgrammer-CiM
  • 17,231
  • 5
  • 42
  • 75
Shridutt Kothari
  • 7,326
  • 3
  • 41
  • 61
  • possible duplicate of [How to enable multidexing with the new Android Multidex support library](http://stackoverflow.com/questions/26609734/how-to-enable-multidexing-with-the-new-android-multidex-support-library) – Sufiyan Ghori Jan 15 '15 at 15:51

1 Answers1

7

You have to modify build.gradle to add multiDexEnabled true under buildconfig, buildType or productFlavour sections

defaultConfig {
    // The support library goes as back as Android-14, and is not required for 21+
    minSdkVersion 14 

    // Enabling multidex support.
    multiDexEnabled true
}

If you're building on old Ant, this is a blocking problem so you'll have to move to gradle or maven or use the old cumbersome solution

http://android-developers.blogspot.com.es/2011/07/custom-class-loading-in-dalvik.html

MLProgrammer-CiM
  • 17,231
  • 5
  • 42
  • 75
  • anything possible with Eclipse?? without using this custom-class-loading-in-dalvik solution?? – Shridutt Kothari Jan 16 '15 at 07:15
  • 2
    Eclipse is just an IDE, a glorified text editor, your problem is with the build tools. Old Android projects use Ant, which has been deprecated precisely because it can't deal with this problems. You can use maven/gradle on Eclipse, move or redo your project using them. – MLProgrammer-CiM Jan 16 '15 at 12:14
  • @MLProgrammer-CiM, your answer is for android studio, not for eclipse. Do you know how to support in eclipse. Please suggest if you know anything. Thanks!! – Jagdish Oct 13 '15 at 11:11
  • @jagdish There's no Eclipse option. Migrate to Android Studio, then apply the solution. – MLProgrammer-CiM Oct 13 '15 at 11:22
  • @MLProgrammer-CiM Thanks for quick response..:) – Jagdish Oct 13 '15 at 11:25
  • Is true you no longer have to change the inheritance of MainApplication per Android docs "Modify your manifest to reference the MultiDexApplication class" http://developer.android.com/tools/building/multidex.html – JPM Jan 22 '16 at 18:06