google / archive-patcher

Automatically exported from code.google.com/p/archive-patcher
Apache License 2.0
534 stars 74 forks source link

Failed to generate patch from APK: java.util.zip.ZipException: EOCD record not found in last 32k of archive, giving up #169

Closed fzyzcjy closed 3 years ago

fzyzcjy commented 3 years ago

I am using this lib to generate patch from an apk file. My environment is docker in MacOS. My previous versions of apk file works very fine, but this version does not work :(

I would appreciate it if any suggestions could be given. Now I cannot deploy new versions of my app!

STDOUT: Exception in thread "main" java.util.zip.ZipException: EOCD record not found in last 32k of archive, giving up
STDOUT:     at com.google.archivepatcher.generator.MinimalZipArchive.listEntriesInternal(MinimalZipArchive.java:72)
STDOUT:     at com.google.archivepatcher.generator.MinimalZipArchive.listEntries(MinimalZipArchive.java:56)
STDOUT:     at com.google.archivepatcher.generator.PreDiffExecutor.generatePreDiffPlan(PreDiffExecutor.java:210)
STDOUT:     at com.google.archivepatcher.generator.PreDiffExecutor.prepareForDiffing(PreDiffExecutor.java:157)
STDOUT:     at com.google.archivepatcher.generator.FileByFileV1DeltaGenerator.generateDelta(FileByFileV1DeltaGenerator.java:81)
STDOUT:     at PatchGenerator.main(PatchGenerator.java:36)
fzyzcjy commented 3 years ago

Ok I see the reason: my file is corrupted.

pspencil commented 3 years ago

EOCD stands for End of Central Directory (record). See Zip Spec (you can search for "4.3.16").

Did you change any of your environment before you observed it stopped working? Is it possible to attach the apk that didn't work?

fzyzcjy commented 3 years ago

@pspencil Thanks for the reply!

I have seen that my file is corrupted, i.e. I do not fully download the file, by looking at the file size - it is abnormally small. Thus, I try to remove the download cache and redownload it, then it works.

pspencil commented 3 years ago

No problem!