android - Proguard 问题 Roboguice 重复导入

标签 android gradle roboguice android-espresso robolectric-gradle-plugin

我在运行我的 gradle 构建时遇到了问题。似乎导入了重复的依赖项,但发现很难调试,任何建议都很好。

Error:Execution failed for task ':proguardDebug'.

java.io.IOException: Can't write [.......\build\intermediates\classes-proguard\debug\classes.jar] (Can't read [.......gradle\caches\modules-2\files-2.1\org.roboguice\roboguice\3.0.1\24e814f35d5cc28eaa7e9f07a50ea69deeb2b544\roboguice-3.0.1.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [roboguice-3.0.1.jar:javax/inject/Inject.class]))

 dependencies {
repositories {
    mavenCentral()
}
compile 'com.google.android:multidex:0.1'
compile files('libs/aws-android-sdk-1.7.1.1.jar')
compile 'com.makeramen:roundedimageview:1.3.0'
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:+'
compile 'com.squareup.picasso:picasso:2.3.3'
compile 'org.codehaus.jackson:jackson-core-asl:1.9.13'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'com.google.android.gms:play-services:+'
compile 'com.androidmapsextensions:android-maps-extensions:2.1.+'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.android.support:support-v4:20.+'
compile 'com.jeremyfeinstein.slidingmenu:library:1.3@aar'
compile('com.commonsware.cwac:camera-v9:0.6.+') {
    exclude module: 'support-v4'
}
compile 'com.squareup:otto:1.3.6'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.squareup.okio:okio:1.2.0'
compile project(':libraries:facebook')
compile files('libs/Catalano.Core.jar')
compile files('libs/Catalano.Android.Image.jar')
compile files('libs/Catalano.Math.jar')
compile 'org.roboguice:roboguice:3.+'
provided 'org.roboguice:roboblender:3.+'
compile 'com.google.code.findbugs:jsr305:3.0.0'

compile 'com.android.support.test.espresso:espresso-core:2.0'
compile 'com.android.support.test:testing-support-lib:0.1'
compile 'com.android.support.test.espresso:espresso-contrib:2.0'
compile 'junit:junit:4.12'
compile 'org.hamcrest:hamcrest-core:1.1'
compile 'org.hamcrest:hamcrest-library:1.1'
compile 'org.hamcrest:hamcrest-integration:1.1'
compile('org.robolectric:robolectric:2.4') {
    exclude module: 'classworlds'
    exclude module: 'commons-logging'
    exclude module: 'httpclient'
    exclude module: 'maven-artifact'
    exclude module: 'maven-artifact-manager'
    exclude module: 'maven-error-diagnostics'
    exclude module: 'maven-model'
    exclude module: 'maven-project'
    exclude module: 'maven-settings'
    exclude module: 'plexus-container-default'
    exclude module: 'plexus-interpolation'
    exclude module: 'plexus-utils'
    exclude module: 'wagon-file'
    exclude module: 'wagon-http-lightweight'
    exclude module: 'wagon-provider-api'
}

最佳答案

您可以通过在项目根目录中运行此命令来找出是什么引入了依赖项:

./gradlew app:androidDependencies

你会得到类似这样的输出: Android Dependencies Output

此外,不要忘记检查您的 app/libs/文件夹,以确保如果您使用 Gradle 将所有内容都拉入其中,它是空的。

关于android - Proguard 问题 Roboguice 重复导入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28963811/

相关文章:

android - notifyItemChanged() 是否强制调用 onBindViewHolder()?

android - 减少gradle包装器的构建时间

android - 如何优化 Roboguice 应用程序以更快地启动?

android - 尝试在 TextView 上设置自定义字体 - 空指针

Android - 罕见的运行时异常,不指向它开始的任何类

java - android 使用 parse.com api 通过推送通知实现聊天

java - Gradle 构建错误 - 程序类型已存在

android - 将 AS 项目迁移到 IDEA 时,无法将 com.android.build.gradle.internal.model.ApiVersionImpl 转换为 java.lang.Integer

android - RoboGuice 注入(inject) AnimatorSet

android - 在 Roboguice 中,我在哪里可以找到 @ContentView?