Commons-Io Duplicate Entry Error Using Robospice and Android Studio

I have been working on the following problem for several hours, but have not come up with a way to solve my problem. I tried the following fixes from Qaru ( Updating Android Studio to 1.0 corrupts MultiDex and Duplicate Zip entry after Gradle Plug-in v0.13.1 ), but none of them worked.

When trying to create my program, the following error occurs:

Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: org/apache/commons/io/CopyUtils.class

It seems like an error indicates that commons-io is included twice in the build process

I use Android Studio and Gradle to include several Robospice dependencies. This is the dependency section of my Gradle build file:

dependencies {
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.google.android.gms:play-services:6.5.87'

    compile'com.google.api-client:google-api-client-android:1.19.0'


    // You must install or update the Google Repository through the SDK manager to use this dependency.
    // The Google Repository (separate from the corresponding library) can be found in the Extras category.
    //compile 'com.google.android.gms:play-services:4.3.23'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile "com.jakewharton:butterknife:${butterknifeVersion}"
    compile 'com.sun.jersey:jersey-bundle:1.8'
    compile 'com.google.code.gson:gson:2.3'
    compile 'org.codehaus.jackson:jackson-core-asl:1.9.0'
    compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.0'

    compile ('com.octo.android.robospice:robospice:1.4.14'){
        exclude module: 'commons-io'
        exclude group: 'commons-io'
    }

    compile ('com.octo.android.robospice:robospice-spring-android:1.4.14'){
        exclude group: 'org.apache.commons', module: 'commons-io'
    }

    compile 'com.squareup.okhttp:okhttp:2.1.0'

    compile ('com.octo.android.robospice:robospice-google-http-client:1.4.14'){
        exclude module: 'xpp3'
        exclude group: 'stax'
    }

    compile 'org.scribe:scribe:1.3.5'
    compile files("$buildDir/native-libs/native-libs.jar")

}

" gradlew -q: " , com.octo.android.robospice: robospice: 1.4.14 commons-io. :

+--- com.octo.android.robospice:robospice:1.4.14
|    \--- com.octo.android.robospice:robospice-cache:1.4.14
|         +--- org.apache.commons:commons-lang3:3.3.2
|         \--- org.apache.commons:commons-io:1.3.2
|              \--- commons-io:commons-io:1.3.2

- , commons-io Robospice Gradle. commons-io org.apache.commons, .

, , , .

+4
2

Robospice, Gradle 2.1: https://github.com/stephanenicolas/robospice/issues/365. .

, org.apache.commons:commons-io all Robospice commons-io:commons-io:1.3.2 . :

// workaround (https://github.com/stephanenicolas/robospice/issues/365)
// remove when robospice updates to 1.4.15+
compile ('com.octo.android.robospice:robospice-retrofit:1.4.14') {
    exclude group: 'org.apache.commons', module: 'commons-io'
}
compile ('com.octo.android.robospice:robospice-ormlite:1.4.14') {
    exclude group: 'org.apache.commons', module: 'commons-io'
}
compile 'commons-io:commons-io:1.3.2'
+11

, , .

1: , zip. Android Studio. gradlew -q dependencies app:dependencies

('net.yazeed44.imagepicker: imagepicker: 1.3.0') .

2: , commons-io

compile ('net.yazeed44.imagepicker:imagepicker:1.3.0'){
        exclude group: 'org.apache.commons', module: 'commons-io'
}  

3: commons-io. compile 'commons-io:commons-io:1.3.2'

.

0

Source: https://habr.com/ru/post/1569731/


All Articles