我尽力从intelij导入一个项目,我得到这个很长的错误,我无法理解。我尝试了“无效并重启”并得到了同样的错误。我不知道如果我的任何构建文件与此错误相关,如果您有任何建议,请告知我,我将使用它进行更新。
错误:任务':app:dexDebug'执行失败。
com.android.ide.common.internal.LoggedErrorException:无法运行命令: C:\ Users \ Nick \ AppData \ Local \ Android \ android-sdk \ build-tools \ 20.0.0 \ dx.bat --dex --no-optimize --output C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ dex \ debug C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ classes \ debug C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ support-annotations-21.0.2-0a182725e9aa175cb2c9765c57055aaa824304e6.jar C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ picasso-2.1.1-ca3ca17668b6992af9c01975b92b9bf572784f6a.jar C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ libGoogleAnalyticsV2-767507628f16b98644c7df4c6626869f426ce4e7.jar C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ internal_impl-21.0。 2-a8cad4df1b726255aab2a982204a5f72da2f18c3.jar C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ amazon-ads-5.4.46-736982c75f8a8e92a0ad571df866edd9f053f48a.jar C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ android-support-v4-570a9308b85abcb60e3a8fe6408341585e0080ba.jar C :\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ classes-886dcf9785070a0ce74d9b194160c2ed98e7f5a6.jar C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ android-support-v7-47c2bab1cd06319a40ed131420476fad110b3621.jar C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ classes-cde05798e7e54ac95eab6032df408c4025bb501c.jar C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ libGoogleAnalyticsServices-4179946d7621a48fc3cc005840f233ec074f4ad9.jar C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ pre-dexed \ debug \ classes-e97fdf43369bbf65731abaad5e4fd840d08f90a7.ja [R 错误代码: 2 输出: 意外的顶级例外情况: com.android.dex.DexException:多个dex文件定义了Landroid / support / v4 / accessibilityservice / AccessibilityServiceInfoCompatIcs; 在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)
将构建工具更改为21.1.1会导致此错误:
错误:任务':app:dexDebug'执行失败。
com.android.ide.common.internal.LoggedErrorException:无法运行命令: C:\ Users \ Nick \ AppData \ Local \ Android \ android-sdk \ build-tools \ 21.1.1 \ dx.bat --dex --no-optimize --output C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ dex \ debug --input-list = C:\ Users \ Nick \ AndroidStudioProjects \ NameThatPlaneQuiz \ app \ build \ intermediates \ tmp \ dex \ debug \ inputList.txt 错误代码: 2 输出: 意外的顶级例外情况: com.android.dex.DexException:多个dex文件定义Lcom / google / analytics / tracking / android / AnalyticsClient; 在com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) 在com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) 在com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) 在com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171) 在com.android.dx.merge.DexMerger.merge(DexMerger.java:189) 在com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454) 在com.android.dx.command.dexer.Main.runMonoDex(Main.java:302) 在com.android.dx.command.dexer.Main.run(Main.java:245) 在com.android.dx.command.dexer.Main.main(Main.java:214) 在com.android.dx.command.Main.main(Main.java:106)
答案 0 :(得分:0)
com.android.dex.DexException: Multiple dex files define
com/google/analytics/tracking/android/AnalyticsClient
错误是由于包含Google Analytics库的多个依赖项(jar,aars或项目)造成的。这可能是因为:
build
文件夹中查看Android Studio(通常为{ {1}})查看您发布的错误中引用的包的重复条目。如果#1不起作用,我首先要审核所有项目的依赖项。一般来说,我远离项目结构对话框,只需手动编辑.gradle文件。我建议将.gradle文件的编辑版本添加到您的问题中。