NativeScript 在 Mac OS 上找不到 Android SDK [英] NativeScript can't find Android SDK on Mac OS

查看:26
本文介绍了NativeScript 在 Mac OS 上找不到 Android SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 NativeScript 并且我尝试执行 tns platform add android 但它不起作用.ANDROID_HOME 路径是正确的,我已经安装了 SDK(API 22 和最新版本)和工具(25.0.2).当我运行 tns doctor 时,它说:

I've installed NativeScript and I try to do tns platform add android but it doesn't work. ANDROID_HOME path is correct and I have installed SDK (API 22 and the newest one) and tools (25.0.2). When I run tns doctor it says:

WARNING: The Android SDK is not installed or is not configured properly.
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.

You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=25.0.2'.

You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.

推荐答案

当前版本的 NativeScript 2.5.2 要求某些工具位于 Android 主目录中,以便它可以检测到它们.最新版本的 Android SDK(2017 年 3 月)实际上删除了主要的 android 支持文件,并将几个二进制文件移动到其他目录中以进行清理.

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.

不幸的是,这会导致 NativeScript 无法检测到您拥有 SDK.此版本的 SDK 是在当前版本的 NativeScript 之后发布的.

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.

我能想到的最简单的解决方法是从命令行开始;sdkmanager 然后选择下载旧的 25.2.3 工具.

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.

手动执行此操作;您需要删除 sdk/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)

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)

然后将它们解压到 sdk/tools 目录中.

Then extract these into that sdk/tools directory.

这篇关于NativeScript 在 Mac OS 上找不到 Android SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆