本文介紹了錯(cuò)誤 :: 打包 APK 時(shí)出現(xiàn)重復(fù)文件的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
Android 工作室.我在應(yīng)用程序運(yùn)行期間遇到這種錯(cuò)誤.
Android Studio. I'm getting this kind of error during application run.
錯(cuò)誤:任務(wù) ':app:packageDebug' 執(zhí)行失敗.APK META-INF/notice.txt 中復(fù)制的重復(fù)文件
build.gradle
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ASL2.0'
}
defaultConfig {
minSdkVersion 7
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:19.0.1'
compile 'com.j256.ormlite:ormlite-android:4.48'
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'
}
我該如何解決這個(gè)錯(cuò)誤?
How can I fix this error?
已編輯
這些排除選項(xiàng)解決了我的問題:
These exclude options solved my problem:
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'
}
推薦答案
我認(rèn)為字符串比較是區(qū)分大小寫的.嘗試使用 exclude 'META-INF/notice.txt'
I think the string comparison is case sensitive. try with exclude 'META-INF/notice.txt'
這篇關(guān)于錯(cuò)誤 :: 打包 APK 時(shí)出現(xiàn)重復(fù)文件的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!