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

查看:96
本文介绍了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天全站免登陆