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

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

问题描述

我正在尝试在 Eclipse 中构建 Multidex apk,但未能成功.

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

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

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

  1. 我已将位于/extras/android/support/multidex/的 Multidex 库添加到我的项目中.
  2. 由于我的应用程序具有自定义应用程序类,因此我已将 android.support.multidex.MultiDexApplication 类扩展到我的应用程序.

我仍然无法构建 apk.

Still i am not able to build apk.

Android 开发人员也没有在 Eclipse 中构建 Multidex apk 的任何文档,它只有文档适用于 gradle 和 Android Studio.

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

推荐答案

你必须修改 build.gradle 在 buildconfig、buildType 或 productFlavour 部分下添加 multiDexEnabled true

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
}

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

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天全站免登陆