Android Studio:Gradle出现重复文件错误
我想添加Robospice库时出错;这是我的build.gradle文件:Android Studio:Gradle出现重复文件错误,gradle,android-studio,robospice,Gradle,Android Studio,Robospice,我想添加Robospice库时出错;这是我的build.gradle文件: apply plugin: 'android' android { // Check on it to know witch Android API level is necessary: // http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels compileSdkVersion 19 b
apply plugin: 'android'
android {
// Check on it to know witch Android API level is necessary:
// http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
compileSdkVersion 19
buildToolsVersion '19.0.1'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile "com.android.support:support-v4:18.0.+"
compile "com.android.support:appcompat-v7:18.0.+"
compile "com.octo.android.robospice:robospice:1.4.11"
}
但不幸的是,Gradle给了我这个错误:
打包APK D:\bla\build\APK\mtc-debug-unaligned.APK期间重复文件
任务“:mtc:packageDebug”的执行失败。
在APK META-INF/LICENSE.txt中复制的重复文件
文件1:C:\Users\Anthony.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-lang3\3.2.1\66f13681add50ca9e4546ffabaaaaac7645db3cf\commons-lang3-3.2.1.jar
文件2:C:\Users\Anthony.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-lang3\3.2.1\66f13681add50ca9e4546ffabaaac7645db3cf\commons-lang3-3.2.1.jar
谢谢你的帮助
Anthony使用以下代码解决您的问题:
android{
包装选项{
排除“META-INF/许可证”
}
}
但是如果问题仍然存在,您必须在生成apk期间查找需要忽略的文件,并添加到打包选项,如上面的代码所示我解决了我的问题;我跟着这个!