I installed Ionic with Angular and the Android platform, immediately afterwards I started the "Ionic Cordova Build Android" command but gives me this error: Error: Unknown Argument: Platform [Error] An Error Occurred While Running Subprocess NG.
CodePudding user response:
You may need to install the packages as explained on https://ionicframework.com/blog/updates-to-ionic-angular-toolkit/
Add update the angular.json file as below. (ionic-cordova-build and ionic-cordova-serve sections)
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"devServerTarget": "app:serve:production"
},
"ci": {
"devServerTarget": "app:serve:ci"
}
}
},
"ionic-cordova-build": {
"builder": "@ionic/cordova-builders:cordova-build",
"options": {
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "app:build:production"
}
}
},
"ionic-cordova-serve": {
"builder": "@ionic/cordova-builders:cordova-serve",
"options": {
"cordovaBuildTarget": "app:ionic-cordova-build",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"cordovaBuildTarget": "app:ionic-cordova-build:production",
"devServerTarget": "app:serve:production"
}
}
}
}
}
},
CodePudding user response:
If you run this command: ng add @ionic/cordova-builders