Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
368 views
in Technique[技术] by (71.8m points)

vnc viewer - Getting "Unable to execute dex: Multiple dex files define" error when trying to run main project which is using other library project

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.

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;

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I resolve this by doing following steps:

  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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...