得到“无法执行dex:多个dex文件定义".尝试运行正在使用其他库项目的主项目时发生错误 [英] Getting "Unable to execute dex: Multiple dex files define" error when trying to run main project which is using other library project

查看:85
本文介绍了得到“无法执行dex:多个dex文件定义".尝试运行正在使用其他库项目的主项目时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将androidVNC开源项目用作MainProject中的Library Project. androidVNC还使用了ZoomerWithKeys库项目.我想通过单击一个按钮在MainProject中启动androidVNC库项目的活动. 我已经完成了所有基本工作,例如在主项目清单中定义了图书馆项目的所有活动.

I am trying use androidVNC open source project as a Library Project in my MainProject. androidVNC has also used ZoomerWithKeys library project. I want start a activity of androidVNC library project in my MainProject by clicking on a Button. I have done all the basic things like to define all the activity of library project in Manifest of main Project.

问题是尝试运行MainProject时出现以下错误- Dex Loader]无法执行dex:多个dex文件定义了Lcom/antlersoft/android/zoomer/R $ drawable; [2013-05-16 15:44:03-OtherProj]转换为Dalvik格式失败:无法执行dex:多个dex文件定义了Lcom/antlersoft/android/zoomer/R $ drawable;

The problem is that i am getting following error when trying to running my MainProject - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/antlersoft/android/zoomer/R$drawable; [2013-05-16 15:44:03 - OtherProj] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/antlersoft/android/zoomer/R$drawable;

谢谢.

推荐答案

我通过执行以下步骤来解决此问题:

I resolve this by doing following steps:

  1. 转到应用程序的bin文件夹,看看哪些库是重复的(在我的库中我有2个支持版本v4 ****)
  2. 将鼠标放在它们上,查看它们的编译位置,请记住,您应该保留最重要的一个,因此,如果您使用的是appcompat和facebookSDK,则应保留来自appcompat的库
  3. 转到其他库(例如facebookSDK)的项目的属性-> Java构建路径->库,并删除越野车lib所来自的依赖关系(在我看来,supportV4嵌套在Android私有库中,所以我删除它), 也可以通过文件管理器执行此操作,转到我们的项目文件夹/库,如果默认情况下未清除该错误库,则删除该错误库
  4. 在该窗口中,删除后,选择Add Jars ...,然后选择另一个项目的库(在我的应用程序中,我从appcompat中选择SupportV4)
  5. 清理您的工作区,重新启动Eclipse
  1. Go to bin folder of you app and see which libraries are duplicated(in mine I had 2 supportv4****)
  2. Hold your mouse on them and see where they compile from, keep in mind that you should keep the most important one, so if you are using appcompat and facebookSDK, you should keep that library which comes from appcompat
  3. Go to the properties of the project of the other library (e.g facebookSDK) -> Java build path -> Libraries and delete the dependency in which the buggy lib come from(in mine, supportV4 nested in Android Private Libraries, so I delete it), Also do it from a file manager, go to our project folder/libs and delete that buggy library if it's not cleaned by default
  4. In that window, after deleting, choose Add Jars... and select the library of the other project(in mine, I choose SupportV4 from appcompat)
  5. Clean you workspace, restart Eclipse

问题应该已经解决了,这些步骤对我来说比正常工作

The problem should have gone, these steps work more than fine for me

这篇关于得到“无法执行dex:多个dex文件定义".尝试运行正在使用其他库项目的主项目时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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