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

Can't unzip file on MacOS Catalina #86

Closed
ephigabay opened this issue Oct 13, 2019 · 7 comments
Closed

Can't unzip file on MacOS Catalina #86

ephigabay opened this issue Oct 13, 2019 · 7 comments
Assignees
Labels
bug Something isn't working resolved

Comments

@ephigabay
Copy link

I'm generating a zip file using zip4j, and it opens perfectly on older MacOS but since upgrading to Catalina I get the following error:
"Unable to expand into 'Downloads'. (Error 79 - Inappropriate file type or format.)"
After playing with the code a bit I narrowed it down to happening only when using streams (addStream) and the compression method is "deflate".
Looking at the logs in the Console I saw this error:
"[ERROR] Couldn't read the header of the entry: Error Domain=NSPOSIXErrorDomain Code=79 UserInfo={NSURL=, NSDebugDescription=}"
Unzipping with the command line works fine.
Tested on the newest version (2.2.2).
Attaching an example zip file.

example.zip

@srikanth-lingala srikanth-lingala self-assigned this Oct 13, 2019
@srikanth-lingala srikanth-lingala added the bug Something isn't working label Oct 13, 2019
@srikanth-lingala
Copy link
Owner

Issue fixed. Will include it in the next release.

@ephigabay
Copy link
Author

@srikanth-lingala Thanks!

@srikanth-lingala
Copy link
Owner

srikanth-lingala commented Oct 19, 2019

Fixed in v2.2.3 released today

@halfdan
Copy link

halfdan commented Mar 9, 2020

@srikanth-lingala Hi there! I'm facing a similar issue currently in an unrelated project. Would you mind explaining what was wrong and how your fix made the produced files compatible with Catalina?

@srikanth-lingala
Copy link
Owner

@halfdan For entries in zip which had extra data record (crc, compressed and uncompressed sizes after the end of data), zip4j was writing uncompressed size as -1 in the local file header, which in theory should not matter because the actual size is in the extra data record. But I guess there were some additional checks added to the zip utility in Catalina, and in those cases where zip4j wrote -1, the zip files could not be opened on Catalina (used to work fine on older versions of Mac). Fix was to write 0 instead of -1. Hope that helped.

@lomchik
Copy link

lomchik commented Feb 16, 2021

This problem again occurred on Mac Os Big Sur v11.1. An archive can not be opened with the default Archive Utility.
But the same file can be opened with terminal unzip utility or with The Unarchiver.
test.zip

@srikanth-lingala please reopen issue.

@srikanth-lingala
Copy link
Owner

@lomchik I have created a new issue #286 from what you have mentioned. The root cause of both these issues are different, and it doesn't make sense to reopen this issue. Please follow the other issue for updates and the reason for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved
Projects
None yet
Development

No branches or pull requests

4 participants