如何解决Duplicate files copied appin APK

android_bug(2)
http://blog.csdn.net/janronehoo/article/details/&
&13629人阅读&&&
android学习(113)&&Android
Studio(1)&
&1 .Duplicate files copied in APK META-INF/LICENSE.txt
&code style=&margin: 0 padding: 0 border: 0 font-family: Consolas, Menlo, Monaco, &Lucida Console&, &Liberation Mono&, &DejaVu Sans Mono&, &Bitstream Vera Sans Mono&, &Courier New&, monospace, sans- white-space:&&&span class=&pln& style=&margin: 0 padding: 0 border: 0 color: rgb(0, 0, 0);&&android &/span&&span class=&pun& style=&margin: 0 padding: 0 border: 0 color: rgb(0, 0, 0);&&{&/span&&span class=&pln& style=&margin: 0 padding: 0 border: 0 color: rgb(0, 0, 0);&&
packagingOptions &/span&&span class=&pun& style=&margin: 0 padding: 0 border: 0 color: rgb(0, 0, 0);&&{&/span&&span class=&pln& style=&margin: 0 padding: 0 border: 0 color: rgb(0, 0, 0);&&
exclude &/span&&span class=&str& style=&margin: 0 padding: 0 border: 0 color: rgb(128, 0, 0);&&'META-INF/LICENSE.txt'&/span&&span class=&pln& style=&margin: 0 padding: 0 border: 0 color: rgb(0, 0, 0);&&
&/span&&span class=&pun& style=&margin: 0 padding: 0 border: 0 color: rgb(0, 0, 0);&&}&/span&&span class=&pln& style=&margin: 0 padding: 0 border: 0 color: rgb(0, 0, 0);&&
&/span&&span class=&pun& style=&margin: 0 padding: 0 border: 0 color: rgb(0, 0, 0);&&}&/span&&/code&
My logcat: log Execution failed for task ':Prog:packageDebug'.
Duplicate files copied in APK META-INF/LICENSE.txt File 1: /home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar File 2: /home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar
&解决方法:
http://blog.csdn.net/u/article/details/
http://blog.csdn.net/u/article/details/
&9854人阅读&&&
android(48)&
今天调试&&应用遇到这么个问题:
Duplicate files copied in APK META-INF/DEPENDENCIES File 1: httpmime-4.3.2.jar File 2: httpmime-4.3.2.jar
貌似说两个包里面的文件重复了还是怎么的,谷歌了一番之后据说应该是 android studio 自身的bug
解决办法:
打开项目下面的 build.gradle 文件,在 android 代码块中添加下面代码
将这些文件全部排出掉就ok了
但不知道这么做会不会有什么隐患,还是有其他更好的解决办法
可以参考下这篇文章:
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:42489次
积分:1087
积分:1087
排名:千里之外
转载:356篇
评论:58条
(69)(76)(62)(40)(59)(59)1814人阅读
android(28)
在app的目录下找到build.gradle 这个文件,在android标签的最后面加入以下信息:
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
完整的信息如下:
apply plugin: 'com.android.application'
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.server.servers"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
buildTypes {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
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 fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:1227286次
积分:11475
积分:11475
排名:第994名
原创:205篇
转载:271篇
评论:130条
(9)(14)(8)(9)(16)(6)(8)(5)(9)(8)(4)(5)(6)(6)(6)(4)(3)(1)(6)(8)(9)(6)(4)(4)(12)(6)(15)(8)(6)(1)(2)(3)(5)(28)(6)(1)(4)(2)(1)(3)(1)(3)(2)(2)(2)(2)(3)(2)(4)(7)(10)(3)(15)(19)(3)(5)(6)(3)(3)(4)(5)(3)(5)(6)(6)(5)(4)(3)(1)(13)(10)(6)(1)(2)(1)(4)(2)(13)(4)(1)(2)(1)(4)(4)(3)(3)(5)(2)&在将vivo eclipse sdk 迁移 android studio& 时候报错
Error:Execution failed for task ':vivosdk:transformResourcesWithMergeJavaResForRelease'.& com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/NOTICE& && &File1: /Users/dsh/mobile/sdks/androidStudio/fvsdk-vivo/vivosdk/libs/httpmime-4.0.jar& && &File2: /Users/dsh/mobile/sdks/androidStudio/fvsdk-vivo/vivosdk/libs/apache-mime4j-0.6.jar
看起来是因为多个 jar 包里包含了同样的文件(NOTICE),导致打包时因为担心相互覆盖问题而提示出错。
packagingOptions {
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
阅读(...) 评论()

我要回帖

更多关于 copied app 的文章

 

随机推荐