在Android中启用MultiDex支持,以在Eclipse中实现65K +方法 [英] Enabling MultiDex Support in Android to achieve 65K+ methods in Eclipse

查看:442
本文介绍了在Android中启用MultiDex支持,以在Eclipse中实现65K +方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我尝试以下步骤,在Android应用程序中配置Multidex支持:


  1. 我已将Multidex库添加到/ extras / android / support / multidex /到我的项目。

  2. 因为我的应用程序有自定义应用程序类,我已经将android.support.multidex.MultiDexApplication类扩展到我的应用程序。

仍然是无法建立apk。



Android开发人员还没有关于在eclipse中构建Multidex apk的任何文档,它仅具有毕业生和Android Studio的文档。

解决方案

您必须修改build.gradle以在buildconfig,buildType或productFlavour部分添加multiDexEnabled true

  defaultConfig {
//支持库返回作为Android-14,并不需要21+
minSdkVersion 14

//启用多重支持。
multiDexEnabled true
}

如果你建立在旧的Ant上,是一个阻塞的问题,所以你必须移动到gradle或maven或使用旧的繁琐的解决方案



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


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.

解决方案

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

这篇关于在Android中启用MultiDex支持,以在Eclipse中实现65K +方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆