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

Error: Failed to extract file invalid END header #290

Open
oiver555 opened this issue Sep 12, 2023 · 1 comment
Open

Error: Failed to extract file invalid END header #290

oiver555 opened this issue Sep 12, 2023 · 1 comment

Comments

@oiver555
Copy link

Describe the bug
When I unzip my .zip file I get this error, Error: Failed to extract file invalid END header (bad central directory offset)
Error: Failed to extract file invalid END header (bad central directory offset). The zip file is not corrupt because I am able to download that file from my firebase account and unzip that very .zip file locally using my computer.

Here is the basic Code

        await utilities.makeDocDir(`${settingsState.currTranslation}/images`)
        await utilities.downloadDocURI(coversURI, `${settingsState.currTranslation}/covers.zip`)

        const targetPath = FileSystem.documentDirectory + `${settingsState.currTranslation}/images`
        const sourcePath = FileSystem.documentDirectory + `${settingsState.currTranslation}/covers.zip`

        const unzipRes = await unzip(sourcePath, targetPath, 'UTF-8') <-- Error Occurs Here`

Expected behavior
To unzip the .zip file like usual

Reproduction
I put together this Expo Snack to show the issue, but for some reason the unzip function is not working, https://snack.expo.dev/@oiver55/8e424e

Env (please complete the following information):

  • Device: Motorola One 5G UW Ace
  • OS: Android
  • OS Version: 12
  • Package Version: 6.0.8

Additional context
Here is a link (https://firebasestorage.googleapis.com/v0/b/vthwritings.appspot.com/o/english%2Fzip%2Fcovers.zip?alt=media&token=1a388104-6499-4eb4-8044-08d1c55755e5) to the zip file in question. Please let me know if you too have the same error if you decide to give it a shot.

@oiver555
Copy link
Author

Please if there is more information you need from me to answer or help just let me know. I don't understand why the unzip function is working in my app from google play store, however when I make a eas debug build of it, it doesn't work.

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

2 participants