Hey Guys i'm a beginner app developer and i chose phonegap please see the problem while adding android as a platform for my project Here's The Code:
c:\Users\pshewale\Desktop\phone gap\hello>phonegap platform add android
npm
http GET https://registry.npmjs.org/cordova-android
npm http 304 https://registry.npmjs.org/cordova-android
Adding android project...
Error: cmd: Command failed with exit code ENOENT
at ChildProcess.whenDone (C:\Users\pshewale\AppData\Roaming\npm\node_modules
\phonegap\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.j
s:134:23)
at ChildProcess.emit (events.js:107:17)
at Process.ChildProcess._handle.onexit (child_process.js:1072:12)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
UPDATE:Thanks I Think It Moved A Bit Ahead But Now It Shows This:
C:\Users\pshewale\hi>cordova platform add android
npm http GET https://registry.npmjs.org/cordova-android
npm http 200 https://registry.npmjs.org/cordova-android
npm http GET https://registry.npmjs.org/cordova-android
npm http 200 https://registry.npmjs.org/cordova-android
npm http GET https://registry.npmjs.org/cordova-android/-/cordova-android-4.0.2.
tgz
npm http 200 https://registry.npmjs.org/cordova-android/-/cordova-android-4.0.2.
tgz
Adding android project...
Error: cmd: Command failed with exit code ENOENT
at ChildProcess.whenDone (C:\Users\pshewale\AppData\Roaming\npm\node_modules
\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:107:17)
at Process.ChildProcess._handle.onexit (child_process.js:1072:12)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
C:\Users\pshewale\hi>
Please add C:\Windows\System32 in your PATH variable
Try to follow these steps:
run
delete the folder
C:\Users\your-name.cordova
go to the project folder and try again
Yes, it works after adding path. Probably it works, because it doesn't write it
Installed platforms: android-broken
.Installation of CORDOVA
Set the Environment Variables of Android SDK:- To add the SDK Tools to the PATH, open the Control Panel, click System and Security, click System, click Change settings, click the Advanced tab, then click the Environment Variables button.
In the list User variables select PATH and click the Edit button.
At the end of the field Variable value, add a semicolon followed by the path to the tools and platform-tools directores of the Android SDK install. Here is an example of what to add (note that there are two paths in one line, separated by a semicolon):
;C:\Users\anshu\AppData\Local\Android\android-sdk\tools;C:\Users\anshu\AppData\Local\Android\android-sdk\platform-tools
You can prepare the path in a text editor, copy it and paste at the end of the input field. Click the OK button when done. Click the OK button again to close the Environment Variables window.
Now test the install. Close any open command windows, open a new command window and type:
adb version This should display the version of the Android Debug Bridge.
After Connecting Android Device in Debugging Mode to Your System VIA USB
In a Windows environment: If you have already installed
cordova
, do the following:npm uninstall cordova -g
ornpm uninstall -g cordova
.cordova
cordova
run the**** platform add android
commandnpm install -g cordova
ornpm install cordova -g
I've been working with
ionic@beta
and the...platform add ...
relies heavily oncordova
so it is recommended to add the platforms BEFORE initiatingcordova
to minimize conflict.Hope this helps.
****
=phonegap
orionic