ionic-cli: ionic build --release browser generates broken zip archive
How to reproduce:
- ionic start myApp maps
- cd myApp
- ionic platform add browser
- ionic build --release browser
- zip -T platforms/browser/build/package.zip
Error:
error: invalid compressed data to inflate ./lib/ionic/fonts/ionicons.ttf
test of platforms/browser/build/package.zip FAILED
We want to build CI system for our ionic app, but we can`t because exit code of unzip process is not zero.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 19
FYI this is not an ionic bug, rather than Cordova-browser bug. In order to have not broken zip archive you can install the patched version from this PR https://github.com/apache/cordova-browser/pull/25
IDK why the original maintainers haven’t fixed it yet.
+1
I also have this problem
+1
I’m seeing something similar, mostly affecting a selection of images. It’s consistently affecting the same images, which I’ve attached, though I’m not sure if it’s the images, or their position in the zip which has problems.
Platform: Ubuntu 14.04, Ionic 1.5.5, zip 3.0 (Info-ZIP), unzip 6.00 Debian / Info-ZIP.
I’ve attached both img/fhrs-images/FHRS/fhrs_0_en-gb.jpg and img/fhrs-images/FHRS/fhrs_1_en-gb.jpg - 0 fails, 1 has no problems (as well as many others) - in case they help.

If I try and access 0 directly from my archive manager, it fails, despite showing the correct file size. Once extracted, these problem files are all 0 bytes.
If I create a manual archive of platforms/browser/www, I can open the problem images fine. Zip -T also reports no problems:
Workaround: This might help for now in a CI context: I’ve found that zipping platforms/browser/www (right click, compress in Nautilus) fixes the problems - the problem files now have data when unzipped, as does:
And this also works when extracted, though is about 3x the size - I guess I forgot a compression switch, and there’ll be some stale caches hanging around for a bit unless you’re busting them.