下议院木卫一重复输入错误使用Robospice和Android工作室 [英] Commons-Io Duplicate Entry Error Using Robospice and Android Studio

查看:600
本文介绍了下议院木卫一重复输入错误使用Robospice和Android工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经工作的以下问题了几个小时,但还没有想出一个办法来解决我的问题。我试图从堆栈溢出(<一下列修复href=\"http://stackoverflow.com/questions/27436641/android-studio-update-to-1-0-corrupts-multidex\">Android工作室更新至1.0腐化MultiDex 和<一个href=\"http://stackoverflow.com/questions/26059838/duplicate-zip-entry-after-gradle-plugin-v0-13-1\">Duplicate摇篮插件v0.13.1 后的ZIP入口),但其中没有一个工作。

I've been working on the following issue for several hours, but haven't come up with a way to solve my problem. I've tried the following fixes from Stack Overflow (Android Studio update to 1.0 corrupts MultiDex and Duplicate Zip Entry after Gradle Plugin v0.13.1) but neither one of them worked.

我试图建立我的程序时,收到以下错误:

I am getting the following error when trying to build my program:

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

该错误似乎表明,在构建过程中被包含两次的commons-io的

The error seems to indicate that commons-io is being included twice in the build process

我使用的Andr​​oid Studio和摇篮到包括多个Robospice依赖。这是我的摇篮建立文件的相关部分:

I am using Android Studio and Gradle to include multiple Robospice dependencies. This is the dependencies 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依赖于公共-IO库。下面是该项目的依赖关系树的相关片段:

Using the "gradlew -q dependencies app:dependencies" command to view the project's dependency tree indicates that com.octo.android.robospice:robospice:1.4.14 is dependent on the commons-io library. Here is the relevant snippet of the project dependency tree:

+--- 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的从构建的gradle文件中的所有Robospice相关的依赖性。我也试着改变从公地IO到org.apache.commons组名,而且没有任何工作。

The dependency is still listed even though I excluded commons-io from all Robospice related dependencies in the gradle build file. I also tried changing the group name from commons-io to org.apache.commons, and that did not work either.

我的项目处于停滞状态,直到我得到这个解决,我会AP preciate任何帮助,我可以得到的。

My project is at a standstill until I get this resolved, and I would appreciate any help I can get.

推荐答案

这是一个Robospice已知的和固定的问题,造成潜在的摇篮2.1问题:<一href=\"https://github.com/stephanenicolas/robospice/issues/365\">https://github.com/stephanenicolas/robospice/issues/365.此修复程序会在下一版本发布。

This is a known and fixed problem in Robospice, caused by an underlying Gradle 2.1 issue: https://github.com/stephanenicolas/robospice/issues/365. The fix is going to be released in the next version.

您可以解决它通过排除 org.apache.commons:公地IO 全部 Robospice依赖关系,以及包括的commons-io的:公共-io的1.3.2 手动。像这样的:

You can work around it by excluding org.apache.commons:commons-io from all Robospice dependencies, and include commons-io:commons-io:1.3.2 manually. Like this:

// 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'

这篇关于下议院木卫一重复输入错误使用Robospice和Android工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆