Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to execute dex: Multiple dex files define Landroid/support/v7/appcompat

Tags:

android

I am getting below exception when I try to run my project:

[2014-09-29 11:56:32 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v7/appcompat/R$anim;
[2014-09-29 11:56:32 - PageViewers] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v7/appcompat/R$anim;
like image 409
sandamali perera Avatar asked Sep 29 '14 04:09

sandamali perera


2 Answers

you have twice compat library

So, how I solved this problem:

  1. Import support library as a project from "sdk/extras/android/support/v7/appcompat".
  2. Reference library in your project (for Eclipse, "Properties - Android - Add").
  3. Build projects (for Eclipse, "Projects - Build All"). Make sure, you have "android.support.v7.appcompat" in your main project gen folder.
  4. If it doesn't worked - clean and rebuild project.
like image 98
Adnan Abdollah Zaki Avatar answered Nov 07 '22 06:11

Adnan Abdollah Zaki


I tried a lot but finally I solved it by executing

cd android && ./gradlew clean

refer github issue.

like image 33
Sidharth Taneja Avatar answered Nov 07 '22 04:11

Sidharth Taneja