I try to add the ios platform in my ionic project with capacitor but I have this error:
✔ Copying web assets from www to ios/App/App/public in 1.12s
✔ Creating capacitor.config.json in ios/App/App in 2.02ms
✔ copy ios in 1.14s
✔ Updating iOS plugins in 6.91ms
[info] Found 5 Capacitor plugins for ios:
@capacitor-community/bluetooth-le@2.0.0
@capacitor/app@4.0.1
@capacitor/haptics@4.0.1
@capacitor/keyboard@4.0.1
@capacitor/status-bar@4.0.1
✖ Updating iOS native dependencies with pod install - failed!
✖ update ios - failed!
[error] ERR_SUBPROCESS_COMMAND_NOT_FOUND
Hi @twestrick I double checked my CocoaPods with gem which cocoapods and am running /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods.rb
Perhaps it’s not accessible for Capacitor for some reason?
Also, this appears to be a popular issue, maybe we can work on an answer together for the community?
Here’s my output:
npx cap sync ios
✔ Copying web assets from sisu-app-mobile to ios/App/App/public in 37.83ms
✔ Creating capacitor.config.json in ios/App/App in 659.13μs
✔ copy ios in 59.25ms
✔ Updating iOS plugins in 4.57ms
[info] Found 2 Capacitor plugins for ios:
@capacitor/browser@4.1.0
@capacitor/status-bar@4.1.1
✖ Updating iOS native dependencies with pod install - failed!
✖ update ios - failed!
[error] Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project App.xcodeproj clean
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
2023-01-05 16:59:42.788 xcodebuild[34754:2942555] Writing error result bundle to
/var/folders/q_/6czdd5856cdfr1x767yf5vmw0000gn/T/ResultBundle_2023-05-01_16-59-0042.xcresult
xcodebuild: error: 'App.xcodeproj' does not exist.
It looks like you are getting a different error. For some reason it cannot find your project file. Maybe try a Clean/Rebuild mentioned here. Otherwise, I don’t have any ideas other than Googling. My daily driver is a Linux machine and only use a Cloud Mac to do my iOS builds Hopefully someone else can help!
Ok, I found the reason. My Mac’s arch is M1 and the problem is cocoapods
If you have an M1 - the issue is likely with Cocoapods.
If the other answers here fail, try:
sudo arch -x86_64 gem install ffi
then inside ios/App
arch -x86_64 pod install
then, to see if it works:
cd…
cd…
npx cap sync
Delete the ios folder and restart the ios app. It is probably the quickest, another thing you can do is check pod --version and update it using gem install cocoapods.