我正在尝试使用NativeScript,但是当我尝试运行tns run android
时,它会给我:
$ tns run android
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.
我已经在〜/ .bash_profile
中设置了ANDROID_HOME$ echo $ANDROID_HOME
/Users/mb102/Library/Andriod/sdk
此路径与Android Studio管理器中的内容相匹配,我还下载并设置了设备:
$ tns devices
Connected devices & emulators
Searching for devices...
┌───┬──────────────────────┬──────────┬───────────────────┬──────────┬───────────┐
│ # │ Device Name │ Platform │ Device Identifier │ Type │ Status │
│ 1 │ sdk_google_phone_x86 │ Android │ emulator-5554 │ Emulator │ Connected │
└───┴──────────────────────┴──────────┴───────────────────┴──────────┴───────────┘
还有什么我应该做的吗?
答案 0 :(得分:0)
你路上的错字?
$ echo $ANDROID_HOME
/Users/mb102/Library/Andriod/sdk
应该是:
$ echo $ANDROID_HOME
/Users/mb102/Library/Android/sdk
实际上,不应该是:
$ export ANDROID_HOME=/Users/mb102/Library/Android/sdk