Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.8.6 Throws exception (Cause: zip file is empty) when building with Android Studio #1683

Closed
jaydroid1024 opened this issue Apr 20, 2020 · 6 comments

Comments

@jaydroid1024
Copy link

jaydroid1024 commented Apr 20, 2020

Execution failed for task ':boss:transformClassesWithDexBuilderForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: zip file is empty
2.8.5 is ok

These are the relevant build information I checked, but I'm not sure if it's my problem
AGPBI: {"kind":"error","text":"Zip error while reading '/Users/xuejiewang/AndroidStudioProjects/QLife/package_name_XXX/XXX/build/intermediates/transforms/ajx/debug/**217.jar**': zip file is empty","sources":[{}],"tool":"D8"}

{ "name": "com.google.code.gson:gson:2.8.6_fb48d0051ec11deca68ca08fb0cdfb54", "index": 217, "scopes": ["EXTERNAL_LIBRARIES"], "types": ["CLASSES"], "format": "JAR", "present": true }

@wancong3
Copy link

wancong3 commented May 2, 2020

Yes, 2.8.6 has some bugs in android.

@ganeshpadhayay
Copy link

I am facing this in 2.8.5 also, Did someone find a solution for this? I am stuck on this for days now.

@Marcono1234
Copy link
Collaborator

Could you please try if this still occurs with the latest Gson version? Also try to update the build tools and plugins you are using.

@Marcono1234
Copy link
Collaborator

I am going to close this because no answer has been provided. If you still experience this with the latest Gson version, feel free to comment here again with more details.

@Marcono1234 Marcono1234 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2024
@PVPliangzhen
Copy link

your details is enough, but nobody resolved

@Marcono1234
Copy link
Collaborator

@PVPliangzhen, what do you mean by that? Are you experiencing this issue? If so please mention which Gson version and build tools you are using (ideally try the latest versions), and if possible provide a small complete sample project for reproducing this. Just based on the details provided by the original reporter it is difficult to understand what is causing this and how it can be solved.

Gson 2.8.6 had included the module-info.class file in the root directory of the JAR, which caused issues for build tools, especially for Android. That has been solved in newer Gson versions (see #2013), and also Android and other build tools have improved handling for module-info.class.

That is why I asked if this is actually still a problem with the latest Gson version and build tool versions, because most likely this has already been solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants