Android unable to execute dex : multiple dex files define Landroid

Just today I started getting this exception:

unable to execute dex : multiple dex files define Landroid

Cause: This exception will come if you have multiple version of support library.

Where to check:

  1. Right Click on Project and select Build Path
  2. Check in Libraries if you have support library added (This happens when we do Android Tools -> Fix Project Properties)
  3. If you don’t find any such instance then check if you have copied support library manually into the lib folder of your project
  4. If you don’t find any such duplicates then check how many Android libraries (custom applications like FacebookSDK) 

Remove the duplicate libraries and do a clean -> rebuild

Hope this helps.

Leave a comment