NativeScript can't find Android SDK on Mac OS

孤街浪徒 提交于 2019-12-01 00:51:47

The current version of NativeScript 2.5.2 requires certain tools to be in the Android home directory so that it can detect them. The newest version of Android SDK (Mar 2017) actually removed the primary android support file and moved several binary files into other directories to clean things up.

Unfortunately this causes NativeScript to not be able to detect that you have the SDK. This version of the SDK came out AFTER the current version of NativeScript.

The simplest way to fix this that I can think of is to start from the command line; sdkmanager then choose to download the older 25.2.3 tools.

To manually do this; you would need to delete everything in your sdk/tools folder and download:

https://dl.google.com/android/repository/tools_r25.2.3-windows.zip (Windows) https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip (Macintosh) https://dl.google.com/android/repository/tools_r25.2.3-linux.zip (Linux)

Then extract these into that sdk/tools directory.

I solved this using the SDK manager in Android Studio, having already installed it previously, install all the requirements, namely

tools,platform-tools,android-25,build-tools-25.0.2,extra-android-m2repository,extra-google-m2repository,extra-android-support

Once installed change your ANDROID_HOME environment variable to point to this SDK manager. Typically, it will be at (/Users//Library/Android/sdk)

export ANDROID_HOME=/Users/<user_name>/Library/Android/sdk

Confirm that NativeScript detects your changes by running

tns doctor
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!