问题
I have successfully executed the following commands
$ npm install -g cordova
$ npm install -g ionic
$ ionic start myApp blank
$ cd myApp
$ ionic platform add android
But the next command is not working
$ ionic build android
when I execute the command, I see an error ie "No platforms added to this project. Please use 'cordova platform add platform'"
please help me with your suggestions, thank you
回答1:
please do following:
- npm install -g cordova
- npm install -g ionic
- ionic start myApp blank
- cd myApp
- cordova platform add android
you can use cordova while installing platform in ionic project because Ionic internally use cordova itself.
Please feedback me if error still persist.
Thank you
回答2:
cordova platform rm ios
cordova platform rm android
cordova platform add ios
cordova platform add android
// edit
to execute these commands, you have to be in your root folder (where you have your config.xml)
回答3:
use this command before you build cordova platform add android
.
enjoy your code time.
来源:https://stackoverflow.com/questions/37829827/android-ionic-no-platforms-added-to-this-project