由于更新
Android Studio和gradle,调试和普通版本会给我重复错误:
: duplicate files during packaging of APK /Users/Stu/projects/****/build/apk/*****-debug-unaligned.apk Execution Failed for task ':*****:packageDebug'.
Duplicate files copied in APK Meta-INF/ASL2.0
File 1: /Users/Stu/.gradle/caches/modules-2/files-2.1/org.codehaus.jackson/jackson-mapper-asl/1.9.11/45d70862fa016993193075a1e8e32a01dcf438e8/jackson-mapper-asl-1.9.11.jar
File 2: /Users/Stu/.gradle/caches/modules-2/files-2.1/org.codehaus.jackson/jackson-mapper-asl/1.9.11/45d70862fa016993193075a1e8e32a01dcf438e8/jackson-mapper-asl-1.9.11.jar
我已经将建议的修复添加到build.gradle(Duplicate files copied (Android Studio 0.4.0)):
buildscript { repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' url 'http://dl.bintray.com/populov/maven' } mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.7.+' classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.+' } } apply plugin: 'android' apply plugin: 'android-test' configurations { unitTestCompile.extendsFrom runtime unitTestRuntime.extendsFrom unitTestCompile } repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' url 'http://dl.bintray.com/populov/maven' } mavenCentral() } android { compileSdkVersion 19 buildToolsVersion "19.0.0" defaultConfig { minSdkVersion 17 targetSdkVersion 19 } sourceSets { instrumentTest.setRoot('src/test') } packagingOptions { exclude 'Meta-INF/DEPENDENCIES' exclude 'Meta-INF/NOTICE' exclude 'Meta-INF/LICENSE' exclude 'Meta-INF/LICENSE.txt' exclude 'Meta-INF/NOTICE.txt' } } dependencies { compile ('com.octo.android.robospice:robospice-spring-android:1.4.7') { exclude module: 'support-v4' } compile 'org.codehaus.jackson:jackson-mapper-asl:1.+' compile 'com.android.support:appcompat-v7:+' compile 'com.viewpagerindicator:library:2.4.1@aar' compile 'com.google.android.gms:play-services:4.0.30' testCompile 'junit:junit:4.10' testCompile 'org.robolectric:robolectric:2.+' testCompile 'com.squareup:fest-android:1.0.+' instrumentTestCompile 'junit:junit:4.10' instrumentTestCompile 'org.robolectric:robolectric:2.+' instrumentTestCompile 'com.squareup:fest-android:1.0.+' }