ListViewAnimations库导致顶层,EXCEPTION [英] ListViewAnimations Library Causes TOP-LEVEL-EXCEPTION
问题描述
我试着去使嵌入该库在我的Android项目。
我也非常少,因为在他们的维基说,增加了摇篮编译行编译com.nhaarman.listviewanimations:图书馆:2.6.0
然后,创造了适配器说。
我得到这个错误:
错误:未能执行任务:应用程序:dexDebug。
com.android.ide.common.internal.LoggedErrorException:无法运行命令: /应用/ Android的Studio.app / SDK /集结工具/ 19.1.0 / DX --dex --num线程= 4 - 输出应用程序/生成/中间体/ DEX /调试应用程序/构建/中间体/班/调试应用程序/编译/中间体/依赖缓存/调试应用程序/构建/中间体/ pre-dexed /调试/类-4a718e9bccae9ae73111e208543c09e4aca23f24.jar应用程序/构建/中间体/ pre-dexed /调试/类-65552ddd9b835cec189dfdc89d020dd1d4a05efa。罐子应用程序/生成/中间体/ pre-dexed /调试/类-98d7ab0cdd3d33cece8c7361f5d1834b474bc2d3.jar应用程序/构建/中间体/ pre-dexed /调试/类-a29a6155c296912b05b7b0750843b61b39e9097a.jar应用程序/构建/中间体/ $ P $对dexed /调试/类-b575f5f3eb7608b6d45a001c7473ced02311e5d7.jar应用程序/构建/中间体/ pre-dexed /调试/类-c0baed271e3d073b9c85c0c02747be63142fb326.jar应用程序/构建/中间体/ pre-dexed /调试/类-debf6a19b9bb7e125665b9467f9f225457142b89。罐子应用程序/生成/中间体/ pre-dexed /调试/ GSON-2.2.4-d931d9a27db6fa844edcb42f0c8ab871054b10b0.jar应用程序/构建/中间体/ pre-dexed /调试/库-2.4.0-bda29182e67fb41a3da3dde6a9cf7ba7254190ac.jar应用/build/intermediates/$p$p-dexed/debug/library-2.6.0-09d4145fc0c719919bdb7fe432f3a97be8e0e47e.jar app/build/intermediates/$p$p-dexed/debug/nineoldandroids-2.2.0-872ce4d9aeb3ff50a99b031a1ad9d52170caf747.jar app/build/intermediates/$p$p-dexed/debug/support-v4-19.1.0-fe930dc68beb1e566675ce71b270d4091c6c249b.jar 错误code: 2 输出: 意外的顶级例外: com.android.dex.DexException:多DEX文件定义LCOM / nineoldandroids /动画/动画$ AnimatorListener; 在com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594) 在com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552) 在com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533) 在com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170) 在com.android.dx.merge.DexMerger.merge(DexMerger.java:188) 在com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439) 在com.android.dx.command.dexer.Main.runMonoDex(Main.java:287) 在com.android.dx.command.dexer.Main.run(Main.java:230) 在com.android.dx.command.dexer.Main.main(Main.java:199) 在com.android.dx.command.Main.main(Main.java:103)
我也试着做 gradlew干净assembleDebug
在我的项目的目录,但它并没有帮助。
任何建议,我应该怎么办?
现在的问题是,你必须包括在您的项目中至少有两个库使用 nineoldandroids库
但之一他们正在使用的jar文件在你的项目的libs文件夹,而另一种是引用到其他地方可能Maven的。
所以,解决的办法是从您的库文件夹中删除的jar文件,并删除 build.gradle
编译文件(库/ nineoldandroids-2.4.0.jar)
Im trying to embedd this library in my android project.
I did very little, as said in their wiki, added the gradle compile line compile 'com.nhaarman.listviewanimations:library:2.6.0'
Then, Created the adapter as said.
I get this error:
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: /Applications/Android Studio.app/sdk/build-tools/19.1.0/dx --dex --num-threads=4 --output app/build/intermediates/dex/debug app/build/intermediates/classes/debug app/build/intermediates/dependency-cache/debug app/build/intermediates/pre-dexed/debug/classes-4a718e9bccae9ae73111e208543c09e4aca23f24.jar app/build/intermediates/pre-dexed/debug/classes-65552ddd9b835cec189dfdc89d020dd1d4a05efa.jar app/build/intermediates/pre-dexed/debug/classes-98d7ab0cdd3d33cece8c7361f5d1834b474bc2d3.jar app/build/intermediates/pre-dexed/debug/classes-a29a6155c296912b05b7b0750843b61b39e9097a.jar app/build/intermediates/pre-dexed/debug/classes-b575f5f3eb7608b6d45a001c7473ced02311e5d7.jar app/build/intermediates/pre-dexed/debug/classes-c0baed271e3d073b9c85c0c02747be63142fb326.jar app/build/intermediates/pre-dexed/debug/classes-debf6a19b9bb7e125665b9467f9f225457142b89.jar app/build/intermediates/pre-dexed/debug/gson-2.2.4-d931d9a27db6fa844edcb42f0c8ab871054b10b0.jar app/build/intermediates/pre-dexed/debug/library-2.4.0-bda29182e67fb41a3da3dde6a9cf7ba7254190ac.jar app/build/intermediates/pre-dexed/debug/library-2.6.0-09d4145fc0c719919bdb7fe432f3a97be8e0e47e.jar app/build/intermediates/pre-dexed/debug/nineoldandroids-2.2.0-872ce4d9aeb3ff50a99b031a1ad9d52170caf747.jar app/build/intermediates/pre-dexed/debug/support-v4-19.1.0-fe930dc68beb1e566675ce71b270d4091c6c249b.jar Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lcom/nineoldandroids/animation/Animator$AnimatorListener; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170) at com.android.dx.merge.DexMerger.merge(DexMerger.java:188) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287) at com.android.dx.command.dexer.Main.run(Main.java:230) at com.android.dx.command.dexer.Main.main(Main.java:199) at com.android.dx.command.Main.main(Main.java:103)
I also tried to do gradlew clean assembleDebug
in my project's directory, but it didnt help.
Any suggestions what I should do?
The problem is that you have at least two libraries included in your project using nineoldandroids library
but one of them is using the jar file in the libs folder of your project while the other is referencing it somewhere else probably Maven.
So the solution is to remove the jar file from your libs folder and delete the following line from build.gradle
compile files('libs/nineoldandroids-2.4.0.jar')
这篇关于ListViewAnimations库导致顶层,EXCEPTION的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!