Build issues with XCode 14.2, ios 15.7 and cap 4.6.1 revert to xcode 13.4.1 and cap 4.5.0

I’ve just spent nearly two days trying to figure out why I was getting lots of ‘cannot find in scope’ errors. In particular ‘capacitorCookieManager’ which I traced to a ‘plugin’ in the core. It wasn’t consistent however and I spent an age doing ‘clean build’ and deleting derived data etc etc. The solution was first finding that xcode 14.2 has a potential issue with my iPhone 6s

And then also getting curious about the changes that landed in cap 4.6.0 and cap 4.6.1 - referring to plugins:

BTW the android build on 4.6.1 worked fine, just not IOS on xcode 14.2 and monterey 12.6.2

All fixed now that I’ve downgraded to Xcode 13.4.1 and downgraded to cap 4.5.0 - and a bit of ionic cap update ionic cap sync --prod (to be fair I end up running those like a good luck charm… unclear what the difference is)

Anyway, in case someone else is having the same frustrations, I hope this will help.

1 Like

Sorry, the relevant apple link is: Apple Developer Documentation

See that it doesn’t support ios 15.7

One further update to this in case some poor wretched soul encounters the same problems I did. I finally was able to update to the latest version of capacitor and get it working on iPhone again by doing three things.

  • Firstly it was ‘google google google’ as implored by the Capacitor team help - though finding the right fix was very hard and time consuming, with lots of bad paths followed on the way.

  • Secondly I abandoned testing on my old iPhone6s - yes I know I ‘should’ have an iPhone 14, whatever but I don’t have that kind of money to throw away. I then updated to the latest version of xCode. Oh and downgraded to npm 16 instead of 18 as I heard there was issues there as well.

  • Finally the third thing I did - which may have been the fix all along was to delete the IOS folder and the node_modules folder and npm install from scratch again. It appears all the issues with missing files came from a corrupt node-modules folder. i.e. something inside the automated toolset that is supposed to look after itself. Only after that, the generated swift or object-c or whatever IOS code was correct and it compiled fine with npx cap sync ios and npx cap open ios

Finally as another minor. I don’t bother with ionic cap sync ios any more as it will force a rebuild of the typescript each time (which means in practice needing to do a ionic cap sync ios --prod) which is unnecessary if I already have compiled www code. I hope this helps another googler in the future.

You can run ionic cap sync ios --no-build to skip the build process (reference) :grinning: