Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error creating android subproject when using phonegap run android command

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

like image 538
user1447718 Avatar asked Jul 09 '13 18:07

user1447718


1 Answers

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/

like image 77
Robert Hoffmann Avatar answered Oct 23 '22 17:10

Robert Hoffmann