Android的支持,multidex.jar不工作在Eclipse [英] android-support-multidex.jar not working in eclipse

查看:914
本文介绍了Android的支持,multidex.jar不工作在Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我在我的Andr​​oid项目面临65K方法的限制的问题。然后,我开始在项目实施multidex。当我尝试添加在eclipse这个支持库,这个问题没有解决。不过它显示了65K的限制。但是,当它的做工精细的摇​​篮+ Android的工作室。我怎样才能做到这一点在eclipse?因为我现在不想转投Android的工作室。

Recently i faced 65K method limitation issue in my android project. Then i started to implement multidex in that projects. When i try to add this support library in eclipse, the issue not resolved. Still it showing the 65K limitation. But when its working fine in Gradle+Android studio. How can i achieve this in eclipse? because i don't want to switch to Android studio now.

下面是我遵循的步骤,

1)增加了Android系统的支持,multidex.jar到构建路径, 2)overrided,下面的方法在应用程序类。因为我是继承自定义的应用程序类。

1) Added the android-support-multidex.jar into build path, 2) overrided, the below method in Application class. since i am subclassing custom Application class.

    @Override
protected void attachBaseContext(Context base) {
    // TODO Auto-generated method stub
    super.attachBaseContext(base);
    MultiDex.install(this);
}

但我不能能够在Eclipse中实现这一目标。这个解决的办法?

But i can't able to achieve this in eclipse. Any solution for this?

推荐答案

可能的复制<一href="http://stackoverflow.com/questions/26530654/android-multidex-support-library-using-eclipse">here.从亚历克斯Lipov答:

Possible duplicate here. Answer from Alex Lipov:

它看起来像ADT的蚂蚁任务项目不再保留(这   驻留在遗产文件夹)。因此,如果您不能迁移到摇篮,   您可以编辑<一href="https://android.googlesource.com/platform/tools/base/+/master/legacy/ant-tasks/src/main/java/com/android/ant/DexExecTask.java"相对=nofollow> DexExecTask 手动。你得当然是   当地重建项目。

It looks like ADT's ant-tasks project is no longer maintained (it resides under 'legacy' folder). So if you can't migrate to Gradle, you can edit the DexExecTask manually. You'll have of course to rebuild the project locally..

Maven的Andr​​oid的插件的不支持多点DEX 。但是,它目前有一个小问题:二次DEX   放置在错误的位置中的文件。 努力解决这个问题 pull请求   即,敬请期待!

maven-android-plugin does support multi-dex. However, it currently has a small issue: secondary dex files placed in wrong location. This pull request strives to fix that, so stay tuned!

这篇关于Android的支持,multidex.jar不工作在Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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