I just created a new Ionic Project with blank template. After I have added android platform to that project and tried the following command.
ionic cordova build android
I get the following error
ng.cmd run app:ionic-cordova-build --platform=android
An unhandled exception occurred: Project target does not exist.
See “C:\Users\x~1\AppData\Local\Temp\ng-vh8aNb\angular-errors.log” for further details.
[ERROR] An error occurred while running subprocess ng.
Below is my ionic info
C:\x\ionic6\sampleapp>ionic info
Ionic:
Ionic CLI : 5.4.16 (C:\Users\x\AppData\Roaming\nvm\v16.14.2\node_modules\ionic)
Ionic Framework : @ionic/angular 6.0.12
@angular-devkit/build-angular : 13.2.6
@angular-devkit/schematics : 13.2.6
@angular/cli : 13.2.6
@ionic/angular-toolkit : 6.1.0
Cordova:
Cordova CLI : 11.0.0
Cordova Platforms : android 10.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 3 other plugins)
Utility:
cordova-res : 0.15.4
native-run : not installed
System:
Android SDK Tools : 26.1.1 (C:\Users\x\AppData\Local\Android\Sdk)
NodeJS : v16.14.2 (C:\Program Files\nodejs\node.exe)
npm : 8.5.0
OS : Windows 10
I am using NVM for windows in my environment. Any help in resolving the above issue would be highly appreciated