Dusty Campanella
Dusty Campanella

Reputation: 21

cordova build error : failed to find ANDROID_HOME variable, and android in your PATH

I already set these variables:

echo $ANDROID_HOME => /usr/local/android-sdk-linux

echo $PATH => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools

But this same error remains when I execute "cordova build android" or "cordova run android --device":

Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually. Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory

Do you have any ideas why?

Thanks

Upvotes: 2

Views: 3389

Answers (2)

zachaz35
zachaz35

Reputation: 47

Try downloading the Android Studio, and installing the platform. It should end up in the top level of your user's directory. export ANDROID_HOME=~/Android/Sdk, so you can try that.

Upvotes: 0

obai
obai

Reputation: 417

I got the same error and what helped me solve the problem is removing the android platform from your cordova project and re-adding it.

cordova platform rm android

cordova platform add android

Upvotes: 0

Related Questions