I’m using ionic 6.20.6 and angular 15.0.4 with latest gradle and android studio, also I have cordova 11 installed but when running ionic cordova run android -l I’m getting the following error:
ng.cmd run app:ionic-cordova-serve --host=localhost --port=8100 --platform=android
[ng] This version of CLI is only compatible with Angular versions ^14.0.0,
[ng] but Angular version 15.0.4 was found instead.
[ng]
[ng] Please visit the link below to find instructions on how to update Angular.
[ng] https://update.angular.io/
[ng]
[ERROR] ng has unexpectedly closed (exit code 3).
The Ionic CLI will exit. Please check any output above for error details.
The issue was eventually solved by the ionic team released a newer major version of @ionic/cordova-builders, which add angular 14 support and drop angular 13 support.
So we may need to wait for ionic team release the newer version of @ionic/cordova-builders package for adding angular 15 support.
I come up some options you can do as a quick workaround:
From my personal experience, I prefer option 2. using Capacitor because:
A Capacitor project can utilize both Capacitor plugins and cordova plugins (a cordova project can only utilize cordova plugins), which means you can find a native plugin that suit your need more easily.
It’s easier to modified native project code if need.
But depending on what you are trying to achieve, either options is OK
Hi
Well this change in versions for angular does help me build the application and launch it on Android devices but now on Android emulator I’m getting a new error.
I have attached the screenshot below: