因此,我下载了Android Studio SDK,然后打开了AVD Manager并构建了一个模拟器。如果我单击该模拟器上的“播放”,则它可以完美运行。
现在,如果我运行TNS并运行android,则会收到错误消息:
✖ 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.
在我的bash_profile
中,
export ANDROID_SDK_ROOT=/Users/ME/Library/Android/sdk
export ANDROID_HOME=/Users/ME/Library/Android/sdk
export ANDROID_AVD_HOME=/Users/ME/.android/avd
我知道我有合适的东西,因为它可以在Studio中工作,如果我转到该文件夹,则可以清楚地看到所有内容。
如果我尝试运行
ruby -e "$(curl -fsSL https://www.nativescript.org/setup/mac)"
由于bash_profile
更改了SDK的位置,Now Studio无法正常工作。