Android - ionic - no platforms added to this proje

2019-04-22 03:53发布

问题:

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:

  1. npm install -g cordova
  2. npm install -g ionic
  3. ionic start myApp blank
  4. cd myApp
  5. 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.