Getting “Unable to execute dex: Multiple dex files define” error when trying to run main project which is using other library project

后端 未结 3 1061
半阙折子戏
半阙折子戏 2020-12-04 00:48

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 an

3条回答
  •  孤街浪徒
    2020-12-04 01:19

    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

提交回复
热议问题