-1

I'm using a library by JAR file in android studio, the problem is the library-jar file already has support-v7 , My project also need add support-7 , therefor I get error : Multiple dex files define Landroid/support/v7/appcompat/R$anim; Any help ?

Linh Nguyen
  • 1,264
  • 1
  • 10
  • 22
  • can you check [this](http://stackoverflow.com/questions/33123181/appcompat-v7-conflict-in-android) , [this](http://stackoverflow.com/questions/21102598/android-studio-unexpected-top-level-exception) , [this](http://stackoverflow.com/questions/8059719/unable-to-execute-dex-multiple-dex-files-define) which may helps to solving your problem. – pRaNaY Oct 19 '15 at 04:37
  • Remove the support-v7.jar – Gabriele Mariotti Oct 19 '15 at 06:46

1 Answers1

0

Please try this gradle code into your gradle file.

android {
dexOptions {
preDexLibraries = false
}
}
pRaNaY
  • 24,642
  • 24
  • 96
  • 146
  • I've tried this, but no luck : Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/appcompat/R$anim; – Linh Nguyen Oct 19 '15 at 04:27
  • can you post your `gradle` for more idea? – pRaNaY Oct 19 '15 at 04:35
  • dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.0' compile 'com.android.support:design:23.1.0' compile files('libs/libreoffice.jar') } here is my dependencies – Linh Nguyen Oct 19 '15 at 04:37
  • just make comment `compile 'com.android.support:appcompat-v7:23.1.0'` --> rebuild – pRaNaY Oct 19 '15 at 04:51
  • as per your error suggest `appcompat-v7` already contain in _libreoffice.jar_ – pRaNaY Oct 19 '15 at 04:53
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/92679/discussion-between-pranay-and-linh-nguyen). – pRaNaY Oct 19 '15 at 04:53