Android的 - MultiDex安装 [英] Android - MultiDex Install

查看:303
本文介绍了Android的 - MultiDex安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经超过了6.5万法的限制,通过导入外部库。我已启用ProGuard的,但仍然得到同样的错误。

  [2015-01-12 15时13分39秒 - 地塞米松装载机]无法执行DEX:不是方法ID [0,0xFFFF的]:65536
[2015-01-12十五点13分39秒 - MyFirstGame]转换为Dalvik的格式失败:无法执行DEX:不是方法ID [0,0xFFFF的]:65536

阅读谷歌官方文件之后,似乎我应该配置一个MultiDex支持。我建立使用Eclipse IDE靛蓝我的项目,而没有的build.gradle文件。使用我已经安装了Android的支持库启示录11和Android的支持库启21.0.3的SDK管理器。我已经添加了

 的android:NAME =android.support.multidex.MultiDexApplication

属性,以我的清单文件,我现在尝试执行

  @覆盖
    保护无效attachBaseContext(上下文newBase){
        super.attachBaseContext(newBase);
        MultiDex.install(本);
    }

然而,MultiDex类不能被解决。据谷歌官方文档,这个罐子应该位于/演员/安卓/支持/ multidex /还有就是/支持/目录下没有/ multidex /目录。

我怎么可能会下载并安装MulitDex支持库?


解决方案

  

使用我已经安装了SDK管理器Android的支持库启示录11


这是使用Android Studio或使用摇篮为Android开发其他工具。它的内容会不会psently使用标准的Eclipse $ P $。


  

据谷歌官方文档,这个罐子应该位于/演员/安卓/支持/ multidex /


尝试其中之一:


  1. 按照用于添加支持的说明图书馆的的资源,使用< SDK> /演员/安卓/支持/ multidex /库/


  2. &LT复印件; SDK> /extras/android/support/multidex/library/libs/android-support-multidex.jar JAR到项目的库/ 目录(因为上述的Andr​​oid库项目似乎只包含这个JAR,没有别的)


不要两者都做。做一个或另一个。

更新

下面是截图我的< SDK> /演员/安卓/支持/ ,显示 multidex / 身在何方文档说应该是:

I have exceeded the 65k method limit, by importing an external library. I have enabled ProGuard, but still get the same error.

[2015-01-12 15:13:39 - Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536
[2015-01-12 15:13:39 - MyFirstGame] Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536

After reading the official Google documentation, it seems I should configure a MultiDex support. I am building my project using the Eclipse Indigo IDE, and do not have a build.gradle file. Using the SDK Manager I have installed 'Android Support Repository' Rev. 11 and 'Android Support Library' Rev. 21.0.3. I have added the

android:name="android.support.multidex.MultiDexApplication"

attribute to my manifest file, and am now trying to implement

@Override
    protected void attachBaseContext(Context newBase) {
        super.attachBaseContext(newBase);
        MultiDex.install(this);
    }

However, the 'MultiDex' class cannot be resolved. According to the Official Google Documentation, this jar should be located /extras/android/support/multidex/ There is no /multidex/ directory under the /support/ directory.

How might I download and install the MulitDex Support Library?

解决方案

Using the SDK Manager I have installed 'Android Support Repository' Rev. 11

That is for developers using Android Studio or other tools that use Gradle for Android. Its contents will not be presently used by standard Eclipse.

According to the Official Google Documentation, this jar should be located /extras/android/support/multidex/

Try one of these:

  1. Follow the instructions for adding a support library with resources, using <sdk>/extras/android/support/multidex/library/

  2. Copy the <sdk>/extras/android/support/multidex/library/libs/android-support-multidex.jar JAR into your project's libs/ directory (since the aforementioned Android library project seems to only contain this JAR and nothing else)

Do not do both. Do one or the other.

UPDATE

Here is a screenshot of my <sdk>/extras/android/support/, showing multidex/ right where the docs say it should be:

这篇关于Android的 - MultiDex安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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