3

I have an error when I want to add Robospice library; this is my build.gradle file:

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"
}

But unfortunately, Gradle gives me this error:

duplicate files during packaging of APK D:\blablabla\build\apk\mtc-debug-unaligned.apk Execution failed for task ':mtc:packageDebug'. Duplicate files copied in APK META-INF/LICENSE.txt File 1: C:\Users\Anthony.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-lang3\3.2.1\66f13681add50ca9e4546ffabafaaac7645db3cf\commons-lang3-3.2.1.jar File 2: C:\Users\Anthony.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-lang3\3.2.1\66f13681add50ca9e4546ffabafaaac7645db3cf\commons-lang3-3.2.1.jar

Thanks for your help !

Anthony

anthony
  • 7,653
  • 8
  • 49
  • 101

1 Answers1

0

uses this code to solve your problem:

android{ packagingOptions { exclude 'META-INF/LICENSE' } }

but if the problem remains, you must look for the file you need ignorie during generation of apk.and add to packagingOptions like in the code above

issam
  • 697
  • 1
  • 9
  • 15