How to resolve java.util.zip.ZipException?

后端 未结 11 1091
执念已碎
执念已碎 2020-11-27 05:37

Whever I try to debug and deploy my android application (in Android Studio 0.9) I get the following error:

Execution failed for task \':app:packageAllDebugCl         


        
相关标签:
11条回答
  • 2020-11-27 06:14

    Thread is a bit old, but I got this error too.

    My problem was that I used two different com.google.android.gms:play-services Versions in my gradle file.

    compile 'com.google.android.gms:play-services-gcm:7.5.0'
    compile 'com.google.android.gms:play-services-analytics:7.3.0' // WRONG!
    

    Make sure, that you always use same versions like:

    compile 'com.google.android.gms:play-services-gcm:7.5.0'
    compile 'com.google.android.gms:play-services-analytics:7.5.0'
    
    0 讨论(0)
  • 2020-11-27 06:16

    You are adding a library like this
    (A). compile files('libs/YOUR_LIBRARY.jar')
    and this library package already available in your code.
    comment it like or remove this line
    //compile files('libs/YOUR_LIBRARY.jar')

    How to know duplicate-copy of library in your project:
    unzip your "YOUR_LIBRARY.jar" and see the same class name in your code.

    0 讨论(0)
  • 2020-11-27 06:16

    go to File/Invalidate Chaches/Restart and your problem is solved

    0 讨论(0)
  • 2020-11-27 06:17

    1.update google play service

    2.add

    compile 'com.google.android.gms:play-services-fitness:8.1.0'
    compile 'com.google.android.gms:play-services-wearable:8.1.0'
    

    instead of compile 'com.google.android.gms:play-services:8.1.0'

    in build.gradle file.

    3.

    defaultConfig {
        multiDexEnabled true
    }
    
    dependencies {
        compile 'com.android.support:multidex:1.0.1'
    }
    
    0 讨论(0)
  • 2020-11-27 06:17
    tools:overrideLibrary="com.google.android.gms.location, com.google.android.gms.internal"
    

    Did the trick for me (I guess you should change location with whatever google library you use)

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