user3818938
user3818938

Reputation: 97

CardView and recycleView duplicate error

Hi Im trying to use cardview and recycle view in my android studio project. When i put cardview in to my dependencies it works fine. However, when i add the recycle view in to dependencies an error comes up. can someone tells me how to solve this issue?

my dependencies:

dependencies {
compile files('libs/Parse-1.5.1.jar')
compile files('libs/achartengine-1.1.0.jar')
compile files('libs/android-support-v13.jar')
compile files('libs/picasso-2.3.2.jar')
compile 'com.android.support:cardview-v7:21.0.+'
}

the error code:

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: /Applications/adt-bundle-mac-x86_64-20140702/sdk/build-tools/21.1.1/dx --dex --no-optimize --output /Users/jonathan34c/AndroidstudioProjects/Cue_business1/app/build/intermediates/dex/debug --input-list=/Users/jonathan34c/AndroidstudioProjects/Cue_business1/app/build/intermediates/tmp/dex/debug/inputList.txt Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171) at com.android.dx.merge.DexMerger.merge(DexMerger.java:189) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:302) at com.android.dx.command.dexer.Main.run(Main.java:245) at com.android.dx.command.dexer.Main.main(Main.java:214) at com.android.dx.command.Main.main(Main.java:106)

Upvotes: 1

Views: 599

Answers (1)

Ankit Khare
Ankit Khare

Reputation: 1385

Delete your build folder and then rebuild it. And add dependencies in your app gradle as

dependencies {
   compile 'com.android.support:cardview-v7:21.0.+'
   compile 'com.android.support:recyclerview-v7:21.0.+'
}

Try this might help you.

Upvotes: 1

Related Questions