Gonchar Denys Gonchar Denys - 7 months ago 32
Java Question

Phonegap export to android

I have this working and for long time was all cool, then at some point it stop to work without me having touch it. I see this error

ERROR building one of the platforms: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Detected 'android' command at C:\Users\Tower\bin but no 'tools' directory found near.
Try reinstall Android SDK or update your PATH to include path to valid SDK directory.


When i am doing
echo $ANDROID_HOME
i see
C:\Users\Tower\AppData\Local\Android\android-sdk\platform-tools;C:\Users\Tower\AppData\Local\Android\android-sdk\tools
which is correct and have the android sdk.
When i am doing
echo $JAVA_HOME
that show
C:\Progra~1\Java\jdk1.7.0_79;C:\Progra~1\Java\jdk1.7.0_79\bin
which is also correct.
I have reinstall both java jdk and android sdk.
I am running this on windows 10, x64

Answer

In variable ANDROID_HOME must be only path to the root directory of android-sdk i.e. C:\Users\Tower\AppData\Local\Android\android-sdk.

In JAVA_HOME also must be only path to JDK root directory i.e. C:\Progra~1\Java\jdk1.7.0_79.

This PATHs C:\Users\Tower\AppData\Local\Android\android-sdk\platform-tools;C:\Users\Tower\AppData\Local\Android\android-sdk\tools must be in PATH System Environment Variable.

And this path to jdk bin directory C:\Progra~1\Java\jdk1.7.0_79\bin must be in PATH Environment Variable.

Edit:

PATH should include ; not :