android-support-multidex.jar 无法在 Eclipse 中工作

标签 android eclipse android-support-library android-multidex

最近我在我的 android 项目中遇到了 65K 方法限制问题。然后我开始在该项目中实现 multidex。当我尝试在 eclipse 中添加这个支持库时,问题没有解决。仍然显示 65K 限制。但是当它在 Gradle+Android studio 中工作正常时。我怎样才能在 eclipse 中实现这一目标?因为我现在不想切换到Android studio。

这是我遵循的步骤,

1) 将 android-support-multidex.jar 添加到构建路径中, 2)重写Application类中的以下方法。因为我正在对自定义应用程序类进行子类化。

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

但我无法在 Eclipse 中实现这一点。有什么解决办法吗?

最佳答案

可能重复 here 。亚历克斯·利波夫的回答:

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..

[Edit - 10/25/2014] 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-support-multidex.jar 无法在 Eclipse 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27211246/

相关文章:

android - Android 应用程序中的数据绑定(bind)和 RecyclerView

eclipse - 在 eclipse Neon 上安装 aws toolkit 时如何解决连接问题?

android - 是否可以在我尚未迁移到 android-x 的项目中添加在 android-x 中创建的库作为模块?

android - 使用正确的上下文

android - 通过 mediaCodec dequeueInputBuffer() 解码 h264 数据包返回 "no such buffer is currently available"

java - Android SQLite - 删除并重新创建具有相同表名的表时出现错误列

eclipse - 为什么 Eclipse 以红色突出显示我的代码,我该如何关闭它?

java - Eclipse - 如何处理 xhtml 中的 EL 2.2 concat?

android - CardView 容器中的 View 无法使用圆角半径正确呈现

android.support.v7.app.AppCompatActivity 与 android.support.v4.app.ActivityCompat