Problem
We have an Ionic Angular Monorepo for building mobile Apps. After updating to Capacitor 3, I always get these errors, when I try to use npx cap sync ios
:
Copying web assets from www to ios/App/public in 1.23s
Copying native bridge: ENOENT: no such file or directory, lstat ‘/Users/neocosmo/Workspaces/piipe-app-mono/node_modules/@capacitor/core/native-bridge.js’
copy: ENOENT: no such file or directory, lstat ‘/Users/neocosmo/Workspaces/piipe-app-mono/node_modules/@capacitor/core/native-bridge.js’
[error] [Error: ENOENT: no such file or directory, lstat ‘/Users/neocosmo/Workspaces/piipe-app-mono/node_modules/@capacitor/core/native-bridge.js’] {
errno: -2,
code: ‘ENOENT’,
syscall: ‘lstat’,
path: ‘/Users/neocosmo/Workspaces/piipe-app-mono/node_modules/@capacitor/core/native-bridge.js’
}Updating iOS plugins in 131.68ms
Updating iOS plugins in 131.68ms
Found 11 Capacitor plugins for ios:
@capacitor/app (1.1.1)
@capacitor/browser (1.0.7)
@capacitor/camera (1.3.1)
@capacitor/filesystem (1.1.0)
@capacitor/haptics (1.1.4)
@capacitor/keyboard (1.2.2)
@capacitor/local-notifications (1.1.0)
@capacitor/share (1.1.2)
@capacitor/splash-screen (1.2.2)
@capacitor/status-bar (1.0.8)
@capacitor/storage (1.2.5)
Found 6 Cordova plugins for ios
cordova-plugin-badge (0.8.8)
cordova-plugin-file (6.0.2)
cordova-plugin-file-opener2 (3.0.5)
cordova-plugin-streaming-media (2.3.0)
cordova-plugin-x-socialsharing (6.0.3)
es6-promise-plugin (4.2.2)
Updating iOS native dependencies with “pod install” (may take several minutes)[fatal] TypeError: Cannot read property ‘ios’ of undefined
at getLinkerFlags (/usr/local/lib/node_modules/@capacitor/cli/dist/ios/update.js:252:30)
at generateCordovaPodspec (/usr/local/lib/node_modules/@capacitor/cli/dist/ios/update.js:245:38)
[fatal] TypeError: Cannot read property ‘ios’ of undefined
at getLinkerFlags (/usr/local/lib/node_modules/@capacitor/cli/dist/ios/update.js:252:30)
at generateCordovaPodspec (/usr/local/lib/node_modules/@capacitor/cli/dist/ios/update.js:245:38)
Updating iOS native dependencies with “pod install” (may take several minutes):
update ios:
[error] Analyzing dependencies
[!] No podspec found forCordovaPlugins
in../capacitor-cordova-ios-plugins
Context
I have the newest versions of @capacitor/core, @capacitor/ios, @capacitor/android installed and have also tried several things without success like pod deintegrate
and pod install
afterwards, removing the ios folder and recreating it via npx ionic cap run ios --project=my-project
, deleting and reinstalling node_modules, …
Nothing worked, most of my tries just straight up created more problems.