Nativescript Android仿真器未运行

Nativescript Android仿真器未运行,android,android-emulator,nativescript,android-sdk-tools,android-sdk-2.3,Android,Android Emulator,Nativescript,Android Sdk Tools,Android Sdk 2.3,自从我尝试设置Android环境已经4天了,但还是出现了很多错误。我放弃了重新安装Mac OS,但仍然没有找到解决方案 我按照文档推荐的方式安装了nativescript,但当我运行tns doctor时,出现以下错误: ✔ Getting environment information TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager

自从我尝试设置Android环境已经4天了,但还是出现了很多错误。我放弃了重新安装Mac OS,但仍然没有找到解决方案

我按照文档推荐的方式安装了nativescript,但当我运行
tns doctor
时,出现以下错误:

✔ Getting environment information 

TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.

There seem to be issues with your configuration.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 4.1.2 version and is up to date.
✔ Component tns-core-modules has 4.1.0 version and is up to date.
✖ Component tns-android is not installed.
✖ Component tns-ios is not installed.
✔ 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 update is not required.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✖ The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android. 
 To be able to perform Android build-related operations, set the `ANDROID_HOME` variable to point to the root of your Android SDK installation directory. 

✖ WARNING: adb from the Android SDK is not installed or is not configured properly.  
 For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements 

✖ WARNING: The Android SDK is not installed or is not configured properly. 
 You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK 
and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements 

✖ Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later. 
 Run `$ sdkmanager` to manage your Android SDK versions. 

✖ You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=27'. 
 Run `$ sdkmanager` from your command-line to install required `Android Build Tools`. In case you already have them installed, make sure `ANDROID_HOME` environment variable is set correctly. 

✖ You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system. 
 Run `$ sdkmanager` to manage the Android Support Repository. In case you already have it installed, make sure `ANDROID_HOME` environment variable is set correctly. 

✖ WARNING: CocoaPods is not installed or is not configured properly. 
 You will not be able to build your projects for iOS if they contain plugin with CocoaPod file.
To be able to build such projects, verify that you have installed CocoaPods. 

You have nativescript-cloud extension installed, so you can execute cloud builds, but your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options: 
Select "Configure for Local Builds" to run the setup script and automatically configure your environment for local builds.
Select "Skip Step and Configure Manually" to disregard this option and install any required components manually.
You have nativescript-cloud extension installed, so you can execute cloud builds, but your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options: 
Select "Configure for Local Builds" to run the setup script and automatically configure your environment for local builds.
Select "Skip Step and Configure Manually" to disregard this option and install any required components manually.
? To continue, choose one of the following options:  (Use arrow keys)
❯ Try Cloud Operation 
  Configure for Local Builds 
  Skip Step and Configure Manually 
当我运行tns doctor并选择“配置本地版本”时,它开始重新下载“Google Chrome”、“Homebrew”、“Java SE”等,即使如此,我仍然会收到相同的错误


我试图指定仿真器,即使这样,我也得到了与“tns-doctor”命令相同的输出。

如果您不想安装Android Studio,可以尝试遵循

在macOS上,根据我的经验,最好的解决方案是

之后,您可以使用androidstudio管理SDK版本和Android模拟器(在开发过程中更好地调试、评测和查看日志),并接受许可证

指向Android Studio安装的SDK和构建工具的环境变量(添加到bash配置文件中)包括:

export ANDROID_HOME=/Users/{{ username }}/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
然后,重新启动计算机(否则,您可能无法从Android Studio启动模拟器)。重新启动后,打开一个终端并键入

echo $ANDROID_HOME

验证路径设置是否正确

我试过了,即使不起作用,我还是严格遵循了那里的文档,但是,您能使用TeamViewer查看一下我的环境吗?我甚至准备付钱给你,这简直让我发疯我不知道该怎么做:(我真的不知道我是否能做得比我解释的更好,但你可以按照我的GitHub个人资料上的地址给我发电子邮件。你的电子邮件帐户不在你的个人资料中,我想这是私人的,我可以通过你的twitter帐户与你联系吗?@florian thuin
echo $ANDROID_HOME