Tôi đang theo dõi chính thức NativeScript tutorial và gặp sự cố khi định cấu hình môi trường OS X của mình để phát triển Android.Không thể tìm thấy một SDK Android tương thích để biên dịch khi chạy nền tảng `tns thêm android`
Khi chạy tns platform add android
tôi nhận được lỗi sau:
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 21 or later.
Lệnh tns doctor
cũng trả về cảnh báo về các vấn đề android-sdk:
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 21 or later. Run
$ android
to manage your Android SDK versions. You need to have the Android SDK Build-tools installed on your system. You have to install version 22. Run "android" from your command-line to install required Android Build Tools. You need to have the latest Android Support Repository installed on your system. Run$ android
to manage the Android Support Repository.
cài đặt android-sdk của tôi trông như thế này:
.bash_profile của tôi cũng bao gồm các nội dung sau:
export ANDROID_HOME="/usr/local/Cellar/android-sdk/24.3.4/"
export PATH="$PATH:~/npm-global/bin:/usr/local/Cellar/android-sdk/24.3.4/tools:/usr/local/Cellar/android-sdk/24.3.4/platform-tools"
Tôi có nên đi xa hơn và cố gắng thiết lập các biến môi trường trên toàn hệ thống - không chỉ cho .bash_profile? Ngoài ra, có thể tôi đã bỏ lỡ điều gì đó từ quá trình thiết lập ...
Bất kỳ mẹo nào về cách khắc phục tình trạng này (lệnh, tệp cấu hình, v.v.) sẽ rất tuyệt vời, cảm ơn bạn!
Tôi đang ở tình trạng tương tự. Tôi sẽ cập nhật ở đây khi tôi khắc phục sự cố này. –