机器人工作室0.4重复的文件APK复制META-INF / LICENSE.TXT [英] Android Studio 0.4 Duplicate files copied in APK META-INF/LICENSE.txt
问题描述
在我已经更新了我的工作室从0.3.7到0.4.0,我不能编译我的项目。 我发现计算器解决办法:<一href="http://stackoverflow.com/questions/20673888/duplicate-files-copied-android-studio-0-4-0">Duplicate文件复制(安卓0.4.0工作室)
After I have updated my Studio from 0.3.7 to 0.4.0, i can't compile my project. I found solution on stackoverflow: Duplicate files copied (Android Studio 0.4.0)
更新我的项目摇篮0.7 + 但我不知道,在那里我必须把下一个字符串:
I update my project to gradle 0.7.+ But i don't know, where i'm must put next strings:
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
我的logcat:登录 执行失败的任务:PROG:packageDebug
My logcat: log Execution failed for task ':Prog:packageDebug'.
在APK META-INF / LICENSE.TXT复制重复文件 文件1:/home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar 文件2:/home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar
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
P.S。开发在Ubuntu 13.04
P.S. Develop in ubuntu 13.04
感谢
推荐答案
把依赖条件顶部和packageOptions在最后为我工作。
Putting the dependecies at the top and the packageOptions at the end worked for me.
apply plugin: 'android'.
下面是我的全build.gradle在app文件夹。
Here is my full build.gradle at the app folder.
dependencies {
compile 'com.android.support:support-v4:+'
compile files('libs/apache-mime4j-0.6.jar')
compile files('libs/httpmime-4.0.jar')
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 10
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard- rules.txt'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
编辑:几乎所有的操作系统许可包括为包括执照副本到项目的义务。因此,这意味着,你必须包括你使用到你项目的所有的操作系统许可证的副本。通过排除他们摇篮,你违反了许可证。
Almost all OS licence include the obligation to "include a copy of the licence" into your project. So this means, that you have to include a copy of all OS licences you use into you projects. By "excluding" them in gradle, you violate the licences.
从项目中排除他们可能不是最好的选择。 谢谢R.S.您的信息。
Excluding them from the project might not be the best option. Thank you R.S. for the info.
这篇关于机器人工作室0.4重复的文件APK复制META-INF / LICENSE.TXT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!