Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to execute dex: Multiple dex files define

Tags:

java

android

I know this question has been asked here a few times before. But i haven't seen any possible solution yet. Before i make the project 'Run as Android Application' , if i do not clean it, i receive the following error and have to restart Eclipse ... and clean again.

Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define      Lcom/jstun/core/attribute/MessageAttributeInterface; 

com.jstun.core... is a part of my src folder, of course i can't remove it. And even if i remove that package, another package will show up as an error like:

Unable to execute dex: Multiple dex files define      Landroid/support/v4/app/ActivityCompatHoneycomb; 

I've seen this error since updating to ADT 15, i'm using Eclipse Galileo on Ubuntu Do you have any idea? Thanks for any reply!

like image 245
Tran Ngu Dang Avatar asked Nov 09 '11 02:11

Tran Ngu Dang


1 Answers

This is a build path issue.

  • Make sure your bin folder is not included in your build path.

  • Right click on your project -> go to properties -> Build Path.

  • Make sure that Honeycomb library is in your libs/ folder and not in your source folder.

  • Include the libraries in libs/ individually in the build path.

    BTW, you may want to bring in the android-support-v4 library to get Ice Cream Sandwich support instead of the Honeycomb support library.

like image 64
terry Avatar answered Oct 06 '22 01:10

terry