当我想运行我的应用程序时,我收到以下错误:
app:compileDebugNdk UP-TO-DATE :应用:compileDebugSources :应用:preDexDebug :应用:dexDebug 意外的顶级例外情况: com.android.dex.DexException:多个dex文件定义Landroid / support / annotation / AnimRes; 在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:303) 在com.android.dx.command.dexer.Main.run(Main.java:246) 在com.android.dx.command.dexer.Main.main(Main.java:215) 在com.android.dx.command.Main.main(Main.java:106) 错误:任务':app:dexDebug'。
的执行失败com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令' C:\ Program Files(x86)\ Java \ jdk1.8.0_05 \斌\ java.exe的''完成非零退出值2
gradle脚本的内容是:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
minSdkVersion 10
targetSdkVersion 22
versionCode 289
versionName "2.2.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles 'proguard-android.txt', 'proguard-rules.txt'
}
debug {
debuggable true
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.google.android.gms:play-services-location:7.5.0'
compile 'com.google.android.gms:play-services-maps:7.5.0'
compile('com.facebook.android:facebook-android-sdk:3.23.1') {
exclude group: 'com.google.android', module: 'support-v4'
}
compile('com.crashlytics.sdk.android:crashlytics:2.3.1@aar') {
transitive = true;
}
compile project(':UtilsLibrary')
compile project(':NumberPickerLibrary')
compile project(':drag-sort-listview-lib')
compile project(':GoogleAPI Library')
compile project(':MenuDrawerLibrary')
compile project(':IOLibrary')
compile project(':AR Library')
compile project(':GoogleLicense')
compile project(':android-maps-utils-library')
}

我确信不知何故我添加了两次google库。
感谢。