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

Generate resources fail in M1: Segmentation fault #443

Open
estebancastrosola opened this issue Nov 22, 2022 · 4 comments
Open

Generate resources fail in M1: Segmentation fault #443

estebancastrosola opened this issue Nov 22, 2022 · 4 comments

Comments

@estebancastrosola
Copy link

Hello! I have a problem with capacitor/assets (and also with cordova-res) that I can't generate the resources for iOS on an apple M1 chip. Always the error: segmentation fault

flowww@MacBook-Air-de-FLOWww FLOWww.Apps_FLOWwwMe % npm list -g
/opt/homebrew/lib
├── @angular/[email protected]
├── @capacitor/[email protected]
├── @ionic/[email protected]
├── [email protected]
├── [email protected]
└── [email protected]

npx capacitor-assets generate --ios
Generating assets for ios
zsh: segmentation fault npx capacitor-assets generate --ios

cordova-res ios
WARN: No config.xml file in directory. Skipping config.
zsh: segmentation fault cordova-res ios

I have installed vips with brew (in arm64 arch) even sharp, but it still doesn't work...

flowww@MacBook-Air-de-FLOWww FLOWww.Apps_FLOWwwMe % brew info vips
==> vips: stable 8.13.3
Image processing library
https://github.com/libvips/libvips
/opt/homebrew/Cellar/vips/8.13.3 (96 files, 5.6MB) *
Poured from bottle on 2022-11-22 at 19:39:53
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/vips.rb
License: LGPL-2.1-or-later
==> Dependencies
Build: gobject-introspection ✔, meson ✘, ninja ✔, pkg-config ✔
Required: cairo ✔, cfitsio ✔, cgif ✔, fftw ✔, fontconfig ✔, gettext ✔, glib ✔, imagemagick ✔, jpeg-xl ✔, libexif ✔, libgsf ✔, libheif ✔, libimagequant ✔, libmatio ✔, librsvg ✔, libspng ✔, libtiff ✔, little-cms2 ✔, mozjpeg ✔, openexr ✔, openjpeg ✔, openslide ✔, orc ✔, pango ✔, poppler ✔, webp ✔
==> Analytics
install: 13,339 (30 days), 40,128 (90 days), 120,216 (365 days)
install-on-request: 13,000 (30 days), 39,042 (90 days), 116,922 (365 days)
build-error: 0 (30 days)

Any ideas?

@mlynch
Copy link
Contributor

mlynch commented Nov 23, 2022

I'm not able to reproduce but will leave this open in case others have a similar issue and have more to add, thanks

@knaito-asial
Copy link

knaito-asial commented May 26, 2024

I encountered this issue with capacitor-assets 3.0.5.
On my Apple Silicon Mac, build script was running in a Docker container which is x64 architecture Linux.

After updating sharp to 0.33.4 and use Node.js v18.17.0, the segmentation fault disappeared.
For more details about node version, see withastro/astro#9345 (comment) .

@viking2917
Copy link

viking2917 commented Jun 11, 2024

[UPDATE]: I botched the copy of the new sharp into the directory ./node_modules/@capacitor/assets/node_modules/sharp. When I copied the files properly, the seg fault disappeared. Thanks @knaito-asial


I have the same issue, except it only crashes on Android, not iOS, e.g.

npx capacitor-assets generate --android
fails, but
npx capacitor-assets generate --ios works

@knaito-asial how did you upgrade sharp?

I did
npm install sharp
but that produced a new installation of sharp, rather than updating the one under node_modules/@capacitor/[email protected]. I then copied the new sharp directory into the capacitor/assets/node_modules/sharp directory, but neither of those fixed the segmentation fault...

My ionic info in case relevant:

Ionic:

Ionic CLI : 7.2.0 (/Users/markwatkins/.nvm/versions/node/v20.14.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 7.8.6
@angular-devkit/build-angular : 16.2.14
@angular-devkit/schematics : 16.2.14
@angular/cli : 16.2.14
@ionic/angular-toolkit : 9.0.0

Capacitor:

Capacitor CLI : 6.0.0
@capacitor/android : 6.0.0
@capacitor/core : 6.0.0
@capacitor/ios : 6.0.0

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.14.0 (/Users/markwatkins/.nvm/versions/node/v20.14.0/bin/node)
npm : 10.7.0
OS : macOS Unknown

@modemlooper
Copy link

This is still an issue, sharp dependency needs updated

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

5 participants