bug: Capacitor fails building on MacOS Big Sur (suspecting Apple M1 ARM processor)
See original GitHub issueBug Report
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 2.4.4
@capacitor/core: 2.4.4
@capacitor/android: 2.4.4
@capacitor/electron: 2.4.4
@capacitor/ios: 2.4.4
Installed Dependencies:
@capacitor/android not installed
@capacitor/cli 2.4.4
@capacitor/core 2.4.4
@capacitor/ios 2.4.4
@capacitor/electron not installed
Found 0 Capacitor plugins for ios:
[success] iOS looking great! 👌
Platform(s)
MacOS Big Sur (11.0) - Mac Book Air (ARM M1 chip). Capacitor integrated with Quasar.
Current Behavior
- Almost fresh Quasar install on Windows ; only a few templates adjustments for comfort, so nothing that could have an impact
- Did a git clone on the Mac to test deploying
- Installed module Capacitor and tried to build with
quasar build -m capacitor -T ios
- Result in console : log is at the bottom of this report
Code Reproduction
- MacOS 11.0 Big Sur with M1 ARM processor
- Deploy Quasar base project
- Install required dependencies for Capacitor from Quasar’s documentation (only XCode if I remember correctly)
- Add capacitor module to the project
quasar mode add capacitor
- Then launch
quasar build -m capacitor -T ios
Other Technical Details
Important point to note I think is the ARM chip withing the Mac Book Air.
- Npm version : 6.14.8
- Node verson : 12.20.0
- Npx version : 10.2.2
- CocoaPods version : 1.10.0
Additional Context
Stack
CocoaPods : 1.10.0
Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
RubyGems : 3.0.3
Host : macOS 11.0 (20A2411)
Xcode : 12.2 (12B45b)
Git : git version 2.15.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories :
Plugins
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-trunk : 1.5.0
cocoapods-try : 1.2.0
Stack trace
### Stack
CocoaPods : 1.10.0
Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
RubyGems : 3.0.3
Host : macOS 11.0 (20A2411)
Xcode : 12.2 (12B45b)
Git : git version 2.15.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories :
### Plugins
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-trunk : 1.5.0
cocoapods-try : 1.2.0
### Podfile
ruby
platform :ios, '11.0'
use_frameworks!
# workaround to avoid Xcode caching of Pods that requires
# Product -> Clean Build Folder after new Cordova plugins installed
# Requires CocoaPods 1.6 or newer
install! 'cocoapods', :disable_input_output_paths => true
def capacitor_pods
# Automatic Capacitor Pod dependencies, do not delete
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
# Do not delete
end
target 'App' do
capacitor_pods
# Add your Pods here
end
### Error
LoadError - dlsym(0x7fe291e235f0, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi.rb:6:in `rescue in <top (required)>'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi.rb:6:in `rescue in <top (required)>'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:74:in `cdn_url?'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:177:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:177:in `sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/local/bin/node',
1 verbose cli '/usr/local/lib/node_modules/npx/node_modules/npm/bin/npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'cap@latest',
1 verbose cli '--global',
1 verbose cli '--prefix',
1 verbose cli '/Users/charlie/.npm/_npx/1550',
1 verbose cli '--loglevel',
1 verbose cli 'error',
1 verbose cli '--json'
1 verbose cli ]
2 info using npm@5.1.0
3 info using node@v12.20.0
4 verbose npm-session 83f1c9bdb915742b
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/cap 13ms (from cache)
8 silly pacote tag manifest for cap@latest fetched in 36ms
9 verbose stack TypeError: cb.apply is not a function
9 verbose stack at /usr/local/lib/node_modules/npx/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
9 verbose stack at FSReqCallback.oncomplete (fs.js:169:5)
10 verbose cwd /Users/charlie
11 verbose Darwin 20.1.0
12 verbose argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npx/node_modules/npm/bin/npm-cli.js" "install" "cap@latest" "--global" "--prefix" "/Users/charlie/.npm/_npx/1550" "--loglevel" "error" "--json"
13 verbose node v12.20.0
14 verbose npm v5.1.0
15 error cb.apply is not a function
16 verbose exit [ 1, true ]
Expected Behavior
The capacitor should build normally then export (I think like Cordova does?) the app to emulator.
Thanks anyway for the amazing tech! Cheers, Charlie
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Pls fix m1 chip issues with external monitor hidpi
Can apple pls, pls, pls, tell me when can you fix the problem of m1 chip not support hidpi on external monitors? Or...
Read more >Apple M1 - Wikipedia
Apple M1 is a series of ARM-based systems-on-a-chip (SoCs) designed by Apple Inc. as a central processing unit (CPU) and graphics processing unit...
Read more >Why is Apple's M1 chip so fast? - Hacker News
Apple has been making incremental progress year by year on these processor for their A-series chips. Just nobody believed those Geekbench ...
Read more >Apple MacBook Air with M1 review: new chip, no problem
Apple has released a new MacBook Air with its own processor inside, the Arm-based M1 chip. It makes this laptop very fast and...
Read more >External Package Installation on Apple M1 Chip - ISSM Forum
Reviewing the configure.log file, I found this error: ... (I think it was gfortran 11-experimental-2 for ARM Big Sur (macOS 11)).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In addition to these commands,
I had to run one more command
And then it worked for me!
Yay!
that is a CocoaPods bug related to one of it’s needed dependencies (ffi) not installing on M1, they say they are going to remove the dependency, so won’t be a problem in the future, but for now you need to enable rosetta, install ffi and then you can disable it and pod install should work
more info https://stackoverflow.com/questions/64901180/running-cocoapods-on-apple-silicon-m1/64901980#64901980