gpt4 book ai didi

android - 错误代码 :2 Unexpected Top-level Exception

转载 作者:行者123 更新时间:2023-11-29 00:13:43 28 4
gpt4 key购买 nike

我是 android 开发的新手,在 androidstudio 中导入项目时错误:

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
E:\android\adt-bundle-windows-x86_64-20140321\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --
output E:\android\CFPEvents\Gradleprojectcfp-android- user\app\build\intermediates\dex\debug --input-list=E:\android\CFPEvents\Gradleprojectcfp-android-user\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/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs;
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:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)

输入列表.txt 文件:

E:\android\CFPEvents\Gradleprojectcfp-android-user\app\build\intermediates\classes\debug
E:\android\CFPEvents\Gradleprojectcfp-android- user\app\build\intermediates\pre-dexed\debug\support-annotations-20.0.0- 22f67c0dddc9c688e0794d450b815b28f58e1d83.jar
E:\android\CFPEvents\Gradleprojectcfp-android-user\app\build\intermediates\pre-dexed\debug\internal_impl-20.0.0-70abc57678073852a9e6f7ebae30976bb22ec41d.jar
E:\android\CFPEvents\Gradleprojectcfp-android-user\app\build\intermediates\pre-dexed\debug\universal-image-loader-1.9.1-b9c11698ebf40b256b359f271d0bd7e3629612d8.jar
E:\android\CFPEvents\Gradleprojectcfp-android-user\app\build\intermediates\pre-dexed\debug\xstream-1.4.7-816d435be49dd5bc1f491c17effc3dddbc49ba4a.jar
E:\android\CFPEvents\Gradleprojectcfp-android-user\app\build\intermediates\pre-dexed\debug\libGoogleAnalyticsServices-e2a7597e511aa28da2b973eefa67e920097e0deb.jar
E:\android\CFPEvents\Gradleprojectcfp-android-user\app\build\intermediates\pre-dexed\debug\google-play-services-ee4019f3cee39571bf6dc0f712c4b22b32b6cae3.jar
E:\android\CFPEvents\Gradleprojectcfp-android-user\app\build\intermediates\pre-dexed\debug\android-support-v4-7ec2c6eefdabe7608a38cfb42d3fa0ec0fa556d2.jar
E:\android\CFPEvents\Gradleprojectcfp-android-user\app\build\intermediates\pre-dexed\debug\classes-99d7a950ad16ef4b71207dd3f54ad9df9c933c00.jar
E:\android\CFPEvents\Gradleprojectcfp-android-user\app\build\intermediates\pre-dexed\debug\classes-6090079305bc6decaac8787edd923af44cc8510d.jar

build.gradle 文件:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/libGoogleAnalyticsServices.jar')
compile files('libs/universal-image-loader-1.9.1.jar')
compile files('libs/xstream-1.4.7.jar')
compile files('libs/android-support-v4.jar')
compile files('libs/google-play-services.jar')
compile 'com.google.android.gms:play-services:6.1.71'
}

Android list 文件中添加了 Googleplayserices

android:minSdkversion="14"android:targetSDKversion="19"

请帮帮我

最佳答案

如果您的项目中有多个相同库的实例作为依赖项,则会发生此问题。特定于您的是 Google play 服务

删除

编译文件('libs/google-play-services.jar')

从您的 build.gradle 中删除 jar,并从您的 libs 目录中删除 jar,因为您通过在 dependencies 闭包中编写第一行将 lib 目录中的所有 jar 包含到您的依赖项中。 完成所有操作后将您的项目与 gradle 同步。

关于android - 错误代码 :2 Unexpected Top-level Exception,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28167649/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com