Nativescript&q;警告:Android SDK未安装或配置不正确&q;

本教程将介绍Nativescript&q;警告:Android SDK未安装或配置不正确&q;的处理方法,这篇教程是从别的地方看到的,然后加了一些国外程序员的疑问与解答,希望能对你有所帮助,好了,下面开始学习吧。

Nativescript&q;警告:Android SDK未安装或配置不正确&q; 教程 第1张

问题描述

这似乎是一个常见问题,但无论存在多少解决方案,我似乎都无法修复它。

我也不明白的是,为什么TNS Doctor在同一台计算机上的另一个用户上工作得很好,但是,我在我的用户上收到了以下错误。有什么想法吗?

✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 6.7.8 and the latest available version is 8.1.5.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.5.1 satisfies minimum required version 10.
✖ WARNING: The Android SDK is not installed or is not configured properly.

以下是我的环境变量,请注意,在TNS Doctor工作正常的用户中,这些变量是相同的。

$ANDROID_HOME = usr/local/share/android-sdk
$ANDROID_SDK_ROOT = usr/local/share/android-sdk
$PATH=/Users/jenkins/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:

我已尝试重新安装nativescript。

提前感谢

推荐答案

请确保您的Android SDK已安装,并根据实际安装的sdk文件夹(见下文)指向$ANDROID_HOME $ANDROID_SDK_ROOT内部。

我发现最好的检查方式是安装Android Studio,然后打开SDK管理器:

然后仔细检查Android-SDK位置是否与上面的$ANDROID_HOME $ANDROID_SDK_ROOT匹配,并确保选中的包如下图所示:

(我安装的Android SDK构建工具-橙点-是30.0.2和26.0.3版本,而不是最新版本)。

另外,请确保您已在以下屏幕上安装了所需的Android API:

请确保通过重新启动终端或运行source ./bash_profile重新加载环境变量。

好了关于Nativescript&q;警告:Android SDK未安装或配置不正确&q;的教程就到这里就结束了,希望趣模板源码网找到的这篇技术文章能帮助到大家,更多技术教程可以在站内搜索。