本文主要是介绍AndroidStudio Duplicate files copied in APK META-INF/notice.txt 报错,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Android Studio 如果遇到类似以下报错
Error:Execution failed for task ':app:packageDebug'. Duplicate files copied in APK META-INF/notice.txt
可以在build.gradle加入如下代码
packagingOptions {exclude 'META-INF/DEPENDENCIES'exclude 'META-INF/LICENSE'exclude 'META-INF/LICENSE.txt'exclude 'META-INF/license.txt'exclude 'META-INF/NOTICE'exclude 'META-INF/NOTICE.txt'exclude 'META-INF/notice.txt'exclude 'META-INF/ASL2.0'}
全局:
apply plugin: 'android'android {compileSdkVersion 19buildToolsVersion "19.0.1"packagingOptions {exclude 'META-INF/DEPENDENCIES'exclude 'META-INF/LICENSE'exclude 'META-INF/LICENSE.txt'exclude 'META-INF/license.txt'exclude 'META-INF/NOTICE'exclude 'META-INF/NOTICE.txt'exclude 'META-INF/notice.txt'exclude 'META-INF/ASL2.0'}defaultConfig {minSdkVersion 7targetSdkVersion 19versionCode 1versionName "1.0"}buildTypes {release {runProguard falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'}}
}dependencies {compile 'com.android.support:appcompat-v7:19.0.1'compile 'org.codehaus.jackson:jackson-core-asl:1.9.13'compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'compile 'com.octo.android.robospice:robospice:1.4.11'compile 'com.octo.android.robospice:robospice-spring-android:1.4.11'
}
这篇关于AndroidStudio Duplicate files copied in APK META-INF/notice.txt 报错的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!