Enabling MultiDex Support in Android to achieve 65K+ methods in Eclipse

不羁岁月 提交于 2019-12-19 01:36:45

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/27967191/enabling-multidex-support-in-android-to-achieve-65k-methods-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!