0

When I run this command on Windows 8:

c:\firstapp> cordova platform add android

I get the following error:

Error:ANDROID_HOME is set to a non-existant path c://android/android-sdk-windows

Can anyone tell me what's wrong in it and how fix it?

aschipfl
  • 33,626
  • 12
  • 54
  • 99
Neha Dixit
  • 15
  • 1
  • 2
  • 12
  • Where is your android SDK? what's the directory? – AtanuCSE Feb 08 '15 at 16:38
  • SDK is in c drive under android folder – Neha Dixit Feb 10 '15 at 05:37
  • OP, I have no idea if you ever resolved your problem, but it's one I am encountering now. It might be a good week before I can revisit this, but one answer talks about an incompatibiltity between the latest Android SDK and Cordova at that time. And this makes a lot of sense in cases where you have dozens of interacting software packages from different sources. I am going to explore that possibility when I have time to bang my head on this side project again. http://stackoverflow.com/questions/26216081/android-home-is-not-set-and-android-command-not-in-your-path-phonegap – froggythefrog Sep 14 '15 at 06:33

1 Answers1

0

You need to set/add ANDROID_HOME environment variable to where your Android-SDK lies (the directory which includes platform-tools and tools directory). And extend the PATH environment variable to include those two directories as well.

In case you installed the sdk to c:\dev\android\sdk, then ANDROID_HOME must have exactly this path as value. When editing the PATH environment variable, you must add (append) ;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools to it.

Here you can read how to set those variable on a windows system.

dergab
  • 965
  • 7
  • 16
  • Can the ANDROID_HOME variable handle spaces in the path? If not, can it handle a tilde shortened path? Is it expecting a genuine Windows path or do I need to use forward slashes? Do I need to double-escape my backslashes? Currently when I execute "dir %ANDROID_HOME%", I see the SDK directory contents including the tools and platform tools directory. However, when I run "phonegap build android", I get the error message that the OP mentioned. – froggythefrog Sep 14 '15 at 06:11