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

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

Closed
caiiiycuk opened this issue Jun 9, 2015 · 19 comments
Closed

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

caiiiycuk opened this issue Jun 9, 2015 · 19 comments

Comments

@caiiiycuk
Copy link

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.

@mrthehud
Copy link

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
Copy link

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
Copy link

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
Copy link
Author

+1

@electrobabe
Copy link

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
Copy link

for me the same with 1.7.16

@icopp
Copy link

icopp commented Aug 2, 2016

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

@caiiiycuk
Copy link
Author

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
Copy link

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
Copy link

+1

@aszmyd
Copy link

aszmyd commented Nov 24, 2016

The same with the most recent ionic cli 2.1.13

@jameslan
Copy link

jameslan commented Jan 6, 2017

Still closed and won't be fixed?

@Flink91
Copy link

Flink91 commented Jan 20, 2017

I also have this problem

@soumak77
Copy link

soumak77 commented Feb 9, 2017

I'm having the same issue

@Richie765
Copy link

Please reopen, this is still a problem.

@DEG-7
Copy link

DEG-7 commented Mar 7, 2017

+1

@Sh1d0w
Copy link

Sh1d0w commented Mar 8, 2017

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 apache/cordova-browser#25

IDK why the original maintainers haven't fixed it yet.

@Richie765
Copy link

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
Copy link

dsyrstad commented May 5, 2017

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/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests