简体   繁体   中英

Android - Gradle - app:transformResourcesWithMergeJavaResForDebug java.util.zip.ZipException

When building my project I'm getting:

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> java.util.zip.ZipException: error in opening zip file

Already tried invalidating gradle caches, deleting them (folder .android\\build-cache) and looking for similar questions.

I'm using latest android plugin and gradle versions (2.3.0 and 3.3).

Trying with previous versions (2.2.3 and 2.14.1) I get a similar error.

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: Exception while checking library jar

Gradle file is as follows:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "XXXXXXXXXXXXXXXX"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    android.defaultConfig.vectorDrawables.useSupportLibrary = true;
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:25.2.0'
    compile 'com.android.support:design:25.2.0'
    compile 'com.google.maps.android:android-maps-utils:0.4.3'
    compile 'com.google.android.gms:play-services-maps:10.2.0'
    compile 'com.google.android.gms:play-services-location:10.2.0'
    testCompile 'junit:junit:4.12'

    //3rd Party
    compile 'com.getbase:floatingactionbutton:1.10.1'
    compile 'com.jakewharton:butterknife:8.5.1'
    compile 'org.greenrobot:eventbus:3.0.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    compile 'org.parceler:parceler-api:1.1.6'
    annotationProcessor 'org.parceler:parceler:1.1.6'
}

Removing files in app/build dir may help. (It contains a lot of intermediate files, which will be generated again during the next build)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM