如何解决Eclipse中的Multidex错误 [英] How can i resolve multidex error in eclipse

查看:55
本文介绍了如何解决Eclipse中的Multidex错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,其中我使用的应用程序库太多.最近,我将mixpanel lib添加到了我的项目中.之后,构建成功.但是,当我尝试运行该应用程序时,出现错误:

I am developing an application in which app I am using too many libraries. Most recently I added mixpanel lib to my project. After that the build was successful. But when I try to run the app I am getting an error:

[2015-11-06 15:04:54-Dex Loader]无法执行dex:方法ID不在[0,0xffff]中:65536[2015-11-06 15:04:54-]转换为Dalvik格式失败:无法执行dex:方法ID不在[0,0xffff]:65536

[2015-11-06 15:04:54 - Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536 [2015-11-06 15:04:54 -] Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536

我读了很多文章.但是我还没有实现日食.即使我将multidex jar添加到我的应用程序并将我的应用程序类扩展到mulidexapplication,我也会遇到相同的错误.请任何人帮助我.

I have read so many articles. But I have not implemented in eclipse. Even if I add multidex jar to my app and extend my application class to mulidexapplication, I get the same error. Please any one help me.

推荐答案

使用太多库总是会导致此问题.

Working with too many libraries always cause this problem.

确保您不会两次导入同一个库.

make sure you are not importing same library twice.

例如

您使用的库是XYZ,它导入了 AppCompat 库.现在,您正在将该库导入到您的主项目中,该主项目也在导入 AppCompat 库.

You are using library let's say XYZ which imports AppCompat library. now you are importing this library to your main project which is also importing AppCompat library.

现在,此 AppCompat 库已在您的项目中导入了两次.因此,这可能会给您 multiDex 的错误.

Now this AppCompat library has been imported twice in your project. so this may gives you error of multiDex.

,因此您可以从主项目中删除 AppCompact .

so you can remove AppCompact From your main project.

然后清洁并运行.会正常工作.

then clean and run. will work fine.

希望这会对您有所帮助.

hope this will helps you.

这篇关于如何解决Eclipse中的Multidex错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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