I am following an official NativeScript tutorial and having a problem configuring my OS X environment for android development.
When running tns platform add android I receive the following error:
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 21 or later.
The tns doctor command also returns warnings on android-sdk issues:
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 21 or later. Run
$ androidto manage your Android SDK versions. You need to have the Android SDK Build-tools installed on your system. You have to install version 22. Run "android" from your command-line to install required Android Build Tools. You need to have the latest Android Support Repository installed on your system. Run$ androidto manage the Android Support Repository.
My android-sdk installation looks like this:

My .bash_profile also includes the followings:
export ANDROID_HOME="/usr/local/Cellar/android-sdk/24.3.4/" export PATH="$PATH:~/npm-global/bin:/usr/local/Cellar/android-sdk/24.3.4/tools:/usr/local/Cellar/android-sdk/24.3.4/platform-tools" Should I go further and try setting system-wide environment variables - not just for the .bash_profile? Also, it is possible that I missed something from the setup process...
Any tip on how I could debug this situation (commands, config files etc.) would be great, thank you!
To be able to build for Android, install Android SDK 22 or later #3825 Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later #3825
@rashnk it is likely an incorrect path to the ANDROID_HOME directory. Please double check that you can find %ANDROID_HOME%/platforms, %ANDROID_HOME%/tools, %ANDROID_HOME%/extras on your developer machine. It is possible that you have not installed the extras package of the Android SDK that has the android support repositories included.
Run $ android to manage your Android SDK versions. You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system. Run $ android to manage the Android Support Repository.
You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system. Run $ android to manage the Android Support Repository. Please HELP!
Alright, so you need to make sure of following:
Once you have performed steps mentioned above, run tns doctor again and you should see No issues were detected message.
This is because of sudo. The root user has no ANDROID_HOME set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With