# Unable to add android platform

**URL:** <https://forum.ionicframework.com/t/unable-to-add-android-platform/12595>\
**Category:** ionic-v1\
**Created:** [November 13, 2014, 1:42am UTC](https://forum.ionicframework.com/t/unable-to-add-android-platform/12595 "2014-11-13T01:42:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shehanp](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@shehanp](https://forum.ionicframework.com/u/shehanp)\
**Post date:** [November 13, 2014, 1:42am UTC](https://forum.ionicframework.com/t/unable-to-add-android-platform/12595/1 "2014-11-13T01:42:40Z")

</div>

am trying to add the android platform using the following command

`cordova platform add android`

I am presented with the following output:

```auto
[~/practice/myApp]•ionic platform add android
Creating android project...

module.js:340
    throw err;
          ^
Error: Cannot find module 'which'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:27:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
Error: /Users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

```

I have set the `PATH` in my bash\_rc file as such:

`export PATH=${PATH}:/Users/user1/android-sdk-macosx/platform-tools:/Users/user1/android-sdk-macosx/platform-tools`

I was able to add iOS as a platform. I have updated to the latest Android SDK as well.

---

<div class="post-metadata">

**Author:** ![appneur](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@appneur](https://forum.ionicframework.com/u/appneur)\
**Post date:** [November 13, 2014, 2:10am UTC](https://forum.ionicframework.com/t/unable-to-add-android-platform/12595/2 "2014-11-13T02:10:44Z")

</div>

in your directory: try

```
npm install
```

---

<div class="post-metadata">

**Author:** ![shehanp](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@shehanp](https://forum.ionicframework.com/u/shehanp)\
**Post date:** [November 13, 2014, 3:02am UTC](https://forum.ionicframework.com/t/unable-to-add-android-platform/12595/3 "2014-11-13T03:02:21Z")

</div>

I tried that (except I had to use `sudo npm install`).

The same error persists. I’m starting to believe that this may be Cordova related because of the following line:

```
Error: /Users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create: Command failed with exit code 8 

```

However, I just tried `sudo npm -g uninstall cordova` and then `sudo npm -g install cordova` to reinstall - that did not work either.

EDIT:  
`cordova platform add android` also seems to fail.

---

<div class="post-metadata">

**Author:** ![pgangane](https://avatars.discourse-cdn.com/v4/letter/p/e47774/32.png) [@pgangane](https://forum.ionicframework.com/u/pgangane)\
**Post date:** [November 18, 2016, 1:13pm UTC](https://forum.ionicframework.com/t/unable-to-add-android-platform/12595/4 "2016-11-18T13:13:37Z")

</div>

Hi,  
I am also getting the same error. I tried almost all solutions but no-one is working.
