Duplicate Zip Entry after Gradle Plugin v0.13.1

前端 未结 4 980
执笔经年
执笔经年 2020-12-06 01:39

I\'ve been using the Gradle Android plugin v0.12 but I decided to upgrade to the new version, because I needed the new functionality (and the improved speed is always a plus

相关标签:
4条回答
  • 2020-12-06 02:15

    I had the same issue. In my case I hadn't done a build for a few months, and found that the dependency compile 'org.apache.commons:commons-io:1.3.2' is no longer valid (though I guess the jars were still in my local repository).

    Once I changed it to compile 'commons-io:commons-io:1.3.2', proGuard ran fine.

    0 讨论(0)
  • 2020-12-06 02:23

    The problem is in libs that you're using.

    Add in gradle file:

    android {
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/notice.txt'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/MANIFEST.MF'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/NOTICE'
        }
    }
    
    0 讨论(0)
  • 2020-12-06 02:32

    By Using CjS answer I was able to solve this. Even Gaetan Answer is also works.

    Adding to this I solved the Issue by Using This, if your compileSdkVersion is 19(IN MY CASE)

    compile ('org.apache.httpcomponents:httpmime:4.3'){
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    compile ('org.apache.httpcomponents:httpcore:4.4.1'){
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    compile 'commons-io:commons-io:1.3.2'
    

    else if your compileSdkVersion is 23 then use

    android {
    useLibrary 'org.apache.http.legacy'
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        }
    }
    
    0 讨论(0)
  • 2020-12-06 02:34

    I had the same issue when updating to Android Gradle plugin 0.13. I managed to fix it by including retrofit this way in my build.gradle file:

    compile('com.squareup.retrofit:retrofit:1.6.1') {
        exclude group: 'commons-io', module: 'commons-io'
    }
    

    Edit: And can do this on all retrofit and robospice dependcies at once with:

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

    It will get all underlying dependencies automatically (retrofit, robospice-core, robospice-cache, ...).

    0 讨论(0)
提交回复
热议问题