ionic-team / ionic-cli

The Ionic command-line interface
MIT License
1.99k stars 653 forks source link

ionic build --release browser generates broken zip archive #472

Closed caiiiycuk closed 8 years ago

caiiiycuk commented 9 years ago

How to reproduce:

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.

mrthehud commented 9 years ago

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.

james@tower:~/Code/App$ zip -T platforms/browser/build/package.zip
  error:  invalid compressed data to inflate ./css/fonts/ionicons.eot
  error:  invalid compressed data to inflate ./img/default-dish-icon.png
  error:  invalid compressed data to inflate ./img/default-outlet-icon.png
  error:  invalid compressed data to inflate ./img/fhrs-images/FHIS/fhis_improvement_required.jpg
  error:  invalid compressed data to inflate ./img/fhrs-images/FHRS/fhrs_0_en-gb.jpg
  error:  invalid compressed data to inflate ./img/fhrs-images/FHRS/fhrs_4_en-gb.jpg
  error:  invalid compressed data to inflate ./img/fhrs-images/FHRS/fhrs_5_en-gb.jpg
  error:  invalid compressed data to inflate ./img/map/sprites.png
test of platforms/browser/build/package.zip FAILED

zip error: Zip file invalid, could not spawn unzip, or wrong unzip (original files unmodified)

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. fhrs_0_en-gb fhrs_1_en-gb

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:

james@tower:~/Code/App$ zip -T platforms/browser/www/www.zip 
test of platforms/browser/www/www.zip OK

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:

james@tower:~/Code/App$ cd platforms/browser/www
james@tower:~/Code/App$ zip -r ../build/package.zip .
james@tower:~/Code/App$ zip -T ../build/package.zip
test of build/package.zip OK

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.

adamdbradley commented 8 years ago

Greetings @caiiiycuk!

I've closed this issue because my sensors indicated it was old and inactive, and may have already been fixed in recent versions of Ionic. However, if you are still experiencing this issue, please feel free to reopen this issue by creating a new one, and include any examples and other necessary information, so that we can look into it further.

Thank you for allowing me to assist you.

mark-veenstra commented 8 years ago

Errors are still there with ionic 1.2.1, when I test a zip file on Ubuntu I still have the same errors on a build browser release. See also next bug report: https://issues.apache.org/jira/browse/CB-8260

caiiiycuk commented 8 years ago

+1

electrobabe commented 8 years ago

same with 1.2.4 on windows7, extracting the zip with winrar 5.31:

\platforms\browser\build\package.zip: Checksum error in audio\shaker.wav. The file is corrupt
\platforms\browser\build\package.zip: Checksum error in img\ic_reload.png. The file is corrupt
\platforms\browser\build\package.zip: Checksum error in lib\ionic\release\fonts\ionicons.eot. The file is corrupt
\platforms\browser\build\package.zip: Checksum error in lib\ionic\release\fonts\ionicons.woff. The file is corrupt
\platforms\browser\build\package.zip: The archive is corrupt
monavari-lebrecht commented 8 years ago

for me the same with 1.7.16

icopp commented 8 years ago

This is definitely still a problem. I just ran into it myself.

caiiiycuk commented 8 years ago

I think someone should open new issue instead of this. I don`t want to open issue, because i don't use ionic anymore.

bsavelev commented 8 years ago

ionic --version 2.0.0 cordova --version 6.3.1

same here:

zip -T platforms/browser/build/package.zip  ;  echo $?
  error:  invalid compressed data to inflate ./build/fonts/noto-sans-bold.ttf
  error:  invalid compressed data to inflate ./build/fonts/noto-sans-regular.ttf
  error:  invalid compressed data to inflate ./build/fonts/roboto-light.ttf
  error:  invalid compressed data to inflate ./build/fonts/roboto-medium.ttf
  error:  invalid compressed data to inflate ./build/fonts/roboto-regular.ttf
  error:  invalid compressed data to inflate ./img/appicon.png
  error:  invalid compressed data to inflate ./img/themes/1/001.jpg
  error:  invalid compressed data to inflate ./img/themes/1/002.png
test of platforms/browser/build/package.zip FAILED

zip error: Zip file invalid, could not spawn unzip, or wrong unzip (original files unmodified)
8
GabrielStetco commented 7 years ago

+1

aszmyd commented 7 years ago

The same with the most recent ionic cli 2.1.13

jameslan commented 7 years ago

Still closed and won't be fixed?

Flink91 commented 7 years ago

I also have this problem

soumak77 commented 7 years ago

I'm having the same issue

Richie765 commented 7 years ago

Please reopen, this is still a problem.

DEG-7 commented 7 years ago

+1

Sh1d0w commented 7 years ago

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.

Richie765 commented 7 years ago

In case it wasn't clear yet, a work around is to just use the files located in platforms/browser/www/. They seem to be just fine.

dsyrstad commented 7 years ago

platforms/browser/build/package.zip still has the same issue in ionic 3.0.1. It cannot be unzip. Using Ubuntu 16.04. Working around by manually zipping platforms/browser/www/.