07-24-2013 11:17 AM - edited 07-24-2013 11:37 AM
I'm trying to set up a BlackBerry 10 project with Cordova/PhoneGap 3.0.0.
It took me some time to figure out that the platform guide for BlackBerry 10 actually refers to the version available at http://cordova.apache.org/ and has to be installed in a different way than mentioned on the PhoneGap website's front page.
I've successfully created a project and added my Z10 device as a target.
However when trying to execute "build debug z10" or "run z10" I always get the following error:
events.js:72 throw er; // Unhandled 'error' event Error: spawn ENOENT at errnoException (child_process.js:980:11) at Process.ChildProcess._handle.onexit (child_process.js:771:34)
Any solution to this?
Solved! Go to Solution.
07-25-2013 04:31 AM
Yes, I've installed the native SDK and all requirements listed in the guide http://docs.phonegap.com/en/edge/guide_platforms_b
07-25-2013 06:02 AM
According to me as is seems you don't have any problem with the sdk. I think the root cause of your problem is the USB drivers or the Blackberry device drivers you have installed on your PC.
Please take a look at the latest USB and device drivers for your current machine and OS.
Then try connecting your phone.
07-25-2013 10:05 AM
First of all, thank-you for reporting this issue. I'd really like to get to the bottom of it.
I understand your frustration with the documentation. There were a bunch of updates and revisions made recently that did not end up getting published. We're working with Apache to get that fixed ASAP.
The ./cordova/build command accepts "--debug" and "--release" (debug is the default). ./cordova/run has "--target=z10". If you have only setup one target, it will be the default, so you don't really have to pass it in at all. You can find the exact argument list via "--help".
Please try it again and see if you still get that error message. It's something I've not come accross before and could not replicate using the steps you described.
As a side note, the new PhoneGap 3.0 does use the same BlackBerry 10 scripts which are in Apache Cordova, but they are called indirectly (in the same way as cordova-cli). You would call "phonegap platform add blackberry10" and then "phonegap run blackberry10".
07-25-2013 12:01 PM
Thank you, this really gives some context to the two different ways to run these scripts.
I also tried using the new PhoneGap 3.0. The documentation at http://docs.phonegap.com/en/3.0.0/guide_cli_index.
Regarding the Apache Cordova scripts, I just followed your suggestion and tried both "build --debug" and simply "run" as well as "run --target z10 --keystorepass [pass]". My Z10 is the only target I have added so far. Unfortunately I still get the same error.
This is not specific to Cordova 3.0.0 however. Two other people reported the same error message using version 2.9.0 here:
07-26-2013 09:44 AM
I've logged an issue for this here:
Could you please add details about your environment to that?
- OS version
- Node JS version
- Native SDK version
07-29-2013 12:12 PM
We have tracked down the cause of this error to the BlackBerry NDK tools missing from system path.
After installing the BlackBerry Native SDK, its tools must be added to your system path. Either manually add the bin directory to your path or run the following scripts from the directory where you installed the NDK:
Note: running the scripts will only add the tools to your path for the current shell. If you want them to persist, you should add the path to the bin directory using Windows environment settings or Linux/Mac bash profile.
07-30-2013 07:48 AM
Thanks, Bryan. I can confirm that the missing environment variables for the Native SDK were causing this error. Having them set, building and running the app now works fine for me.
09-26-2013 10:50 AM
On some machines the bb_ndk-env.bat file is broken too. I had to replace the first line:
After running the bat file type echo %PATH% and make sure it looks sane.