处理任务时出现异常java.io.ioexception:无法写入或读取

时间:2017-04-14 13:56:23

标签: android gradle android-gradle build.gradle dependency-management

您好我添加了一个新的依赖项,当我尝试运行该应用程序时,我开始收到以下错误:

Warning:Exception while processing task java.io.IOException: Can't write [/Users/paularellano/Documents/Workbench/Android/Huddle/huddle_2.0 updt/Huddle_Android/build/intermediates/transforms/proguard/release/jars/3/1f/main.jar] (Can't read [/Users/paularellano/.android/build-cache/d4e5659d4f4fc411f22ba3f779b09d40beccc03f/output/jars/libs/internal_impl-23.0.1.jar(;;;;;;**.class)] (Duplicate zip entry [internal_impl-23.0.1.jar:android/support/v4/view/WindowInsetsCompat.class]))

我尝试添加排除但我不确定我应该排除哪些删除这个重复的罐子,任何帮助将不胜感激!先感谢您!

摇篮:

compileSdkVersion 23
buildToolsVersion '25.0.2'

dependencies {
    compile ('com.google.android.gms:play-services-location:6.5.87') {
        exclude module: 'support-v4'
    }
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:support-v4:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.google.maps.android:android-maps-utils:0.4'
    compile 'info.hoang8f:android-segmented:1.0.6'

    //expandable recycler view **RECENTLY ADDDED AND GIVES ERROR**
    compile 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1'

    //Testing
    testCompile 'junit:junit:4.12'
    testCompile 'org.robolectric:robolectric:3.1.4'

}

我还在pro guard上添加了这一行,但是没有运气:

-dontwarn com.bignerdranch.**

1 个答案:

答案 0 :(得分:8)

com.bignerdranch.android:expandablerecyclerview库使用支持库版本24.2.1,而您还导入了支持库版本23.0.1

将支持libs版本升级到24.2.1或从expandablerecyclerview库中排除支持lib依赖项。

compile('com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1') {
    exclude group: 'com.android.support', module: 'support-v4'
}

请注意,此可能会中断 expandablerecyclerview 库,因为它是使用较新的支持lib版本编写和测试的。