Error creating android subproject when using phonegap run android command

南笙酒味 提交于 2019-12-04 21:20:34

问题


I installed nodejs and did the following:

npm install -g phonegap
phonegap create <app path>
cd <app path>
phonegap run android

when i execute the run android command, I get below error:

An error occurred during creation of android-sub project.  The system cannot find the project specified.

not sure where this is coming from.

any clues.

Thanks


回答1:


Had the same problems and a hard time finding a solution, however:

  1. Make sure JAVA is installed
    • Set JAVA_HOME & PATH variables
  2. Make sure ANT is installed
    • Set ANT_HOME & PATH variables
  3. Make sure Android SDK is installed
    • Add PATH to sdk/tools
    • Add PATH to sdk/platform-tool
    • Run SDK manager to update & install SDK elements
    • Run AVD manager to create a default emulator image
  4. Install NodeJS (with PATH)
    • Follow the usual tutorials
    • npm install -g cordova
      • cordova create hello com.sample.hello HelloWorld
      • cd hello
      • cordova platform add android
      • cordova build
      • now launch your Emulator
      • cordova emulate android (patience, take ages...)
      • or
      • cordova run android
        • much faster, just make sure you mobile device is connected, on, unlocked, usb debug is on, and drivers are installed
        • if you can't find one try: sdk\extras\google\usb_driver
    • npm install -g phonegap
      • phonegap create hello com.sample.hello HelloWorld
      • cd hello
      • phonegap platform add android (if not working use cordova command)
      • phonegap build android
      • now your launch Emulator
      • phonegap emulate android (patience, take ages...)
      • or
      • phonegap run android
        • much faster, just make sure you mobile device is connected, on, unlocked, usb debug is on, and drivers are installed
        • if you can't find one try: sdk\extras\google\usb_driver

I think the main difference between phonegap/cordova, is phonegap (which belong to Adobe) has the possibility to build in the cloud via https://build.phonegap.com/




回答2:


Whitespace is not allowed i would say



来源:https://stackoverflow.com/questions/17555135/error-creating-android-subproject-when-using-phonegap-run-android-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!