Ionic 5 problem ng subprocess with angular 14

Viewed 1551

I have this problem. When I compile an application and run the command ionic cordova prepare android i see this error:

Error: Unknown argument: platform [ERROR] An error occurred while running subprocess ng.   ng.cmd run app:ionic-cordova-build --platform=android exited with exit code 1. Re-running this command with the --verbose flag may provide more information.

My Config: Angular CLI: 14.0.2 Node: 16.13.0 Package Manager: npm 8.1.0 OS: win32 x64 If i lunch the same command with this config: Angular CLI: 13.0.4 Node: 16.13.0 Package Manager: npm 8.1.0 OS: win32 x64 the project work correctly

Have you a solution??

3 Answers

yo lo logre con este comando ng add @ionic/cordova-builders

This error happen beacause you don't did the migration of an application in Angular to Ionic, the solution is simple.

Run

npm install @ionic/angular@6

If you are using Ionic Angular Server, be sure to update that as well:

npm install @ionic/angular@6 @ionic/angular-server@6

However if that's code don't run try this code:

npm install @ionic/angular@latest @ionic/angular-toolkit@latest --save

if need read the documentation of the migration:

https://ionicframework.com/docs/reference/migration

I hope than help you

try ng add @ionic/cordova-builders

Related