Add platform android error


#1

I can’t add platform android. I’ve been trying to fix this all day but to no avail (uninstalled and reinstalled node, npm, deleted all npm folders, tried to fix the PATH…). Using node 0.12.5, npm 2.11.2, cordova 5.1.1, ionic 1.5.5 on Windows 7.

$ ionic platform add android
Updated the hooks directory to have execute permissions
Adding android project…
Error: cmd: Command failed with exit code ENOENT
at ChildProcess.whenDone (c:\Users\Development\AppData\Roaming\npm\node_modu
les\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)

I’ll appreciate any advice, thanks.


Ionic 'platform add' give an error
#3

Running “cordova -d platform add android” yields a little bit more info. Is some file missing? I can’t figure it out:

$ cordova -d platform add android
No version supplied. Retrieving version from config.xml...
Adding android project...
Running command: cmd "/s /c "C:\Users\Development\.cordova\lib\npm_cache\cordova
-android\4.0.2\package\bin\create.bat --cli "d:\New folder\myApp\platforms\andro
id" com.ionicframework.myapp190466 myApp""
Command finished with error code ENOENT: cmd /s /c "C:\Users\Development\.cordov
a\lib\npm_cache\cordova-android\4.0.2\package\bin\create.bat --cli "d:\New folde
r\myApp\platforms\android" com.ionicframework.myapp190466 myApp"
Error: cmd: Command failed with exit code ENOENT
    at ChildProcess.whenDone (c:\Users\Development\AppData\Roaming\npm\node_modu
les\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)

#4

It as a PATH problem. Somehow, “C:\Windows\System32” wasn’t in the path.


#5

I have the same problem with you.

How can I solve this problem?


#6

In my case I just needed to add “C:\Windows\System32” to my windows path.


#7

Add this
%SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;

in your PATH.

Problem will resolved. It works for my.


#8

did the PATH settings for ANDROID HOME, but still get below errors, Please help if any further pointers?

D:IonicApp\SampleApp>ionic platform add android
Downloading: https://github.com/driftyco/ionic-default-resources/archive/master.
zip
URIError: URI malformed
at decodeURIComponent (native)
at Url.parse (url.js:267:19)
at Object.urlParse [as parse] (url.js:73:5)
at Request.setupTunnel (C:\nodejs_modules\node_modules\ionic\node_modules\re
quest\request.js:296:22)
at Request.init (C:\nodejs_modules\node_modules\ionic\node_modules\request\r
equest.js:426:10)
at new Request (C:\nodejs_modules\node_modules\ionic\node_modules\request\re
quest.js:283:8)
at request (C:\nodejs_modules\node_modules\ionic\node_modules\request\index.
js:50:10)
at Object.fetchArchive (C:\nodejs_modules\node_modules\ionic\node_modules\io
nic-app-lib\lib\utils.js:102:3)
at Object.copyIconFilesIntoResources (C:\nodejs_modules\node_modules\ionic\n
ode_modules\ionic-app-lib\lib\resources.js:955:16)
at C:\nodejs_modules\node_modules\ionic\lib\ionic\platform.js:49:29


#9

did the PATH settings for ANDROID HOME, but still get below errors, Please help if any further pointers?

D:IonicApp\SampleApp>ionic platform add android
Downloading: https://github.com/driftyco/ionic-default-resources/archive/master.
zip
URIError: URI malformed
at decodeURIComponent (native)
at Url.parse (url.js:267:19)
at Object.urlParse as parse
at Request.setupTunnel (C:\nodejs_modules\node_modules\ionic\node_modules\re
quest\request.js:296:22)
at Request.init (C:\nodejs_modules\node_modules\ionic\node_modules\request\r
equest.js:426:10)
at new Request (C:\nodejs_modules\node_modules\ionic\node_modules\request\re
quest.js:283:8)
at request (C:\nodejs_modules\node_modules\ionic\node_modules\request\index.
js:50:10)
at Object.fetchArchive (C:\nodejs_modules\node_modules\ionic\node_modules\io
nic-app-lib\lib\utils.js:102:3)
at Object.copyIconFilesIntoResources (C:\nodejs_modules\node_modules\ionic\n
ode_modules\ionic-app-lib\lib\resources.js:955:16)
at C:\nodejs_modules\node_modules\ionic\lib\ionic\platform.js:49:29

      • List item