NativeScript Installation Issues
Asked Answered
A

2

8

I was just trying to install NavtiveScript, for this I followed the official installation guide available at

http://docs.nativescript.org/angular/start/quick-setup but I am stuck at "Step 3: Install iOS and Android requirements"

When I run the below command in Command Prompt (with administrative privileges)

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://www.nativescript.org/setup/win'))"

Everything seems to be installed without any issue. But when I try to verify the installation through command, "tns doctor" I returns below warnings:

 D:\>tns doctor
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

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

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

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

NOTE: You can develop for iOS only on Mac OS X systems.
To be able to work with iOS devices and projects, you need Mac OS X Mavericks or later.

Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
Run $ android 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 <=24'.
Run android from your command-line to install required Android Build Tools.

You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.
Run $ android  to manage the Android Support Repository.

Can anyone please guide?

I am using Windows 10, and have Visual Studio 2015 (update 3) and Visual Studio Code installed on my machine.

Arnaud answered 25/10, 2016 at 21:29 Comment(1)
up for this. I got an error upon installing chocolatey so the script wasnt able to proceed to installation of jdk and android sdk. Still dont have the answerAmide
H
10

The command line of installing Android also didn't work for me and gave me the same errors as you. I figured out this by downloading and installing Android Studio. After your installation, you should be able to find the location of the android sdk, which is /Users/myMacUserName/Library/Android/sdk in my situation. And you could select all the needed things through SDK Manager. In the terminal, you then do 'export ANDROID_HOME=/Users/myMacUserName/Library/Android/sdk' instead of the command from NativeScript installtion instruction 'export ANDROID_HOME=/usr/local/opt/android-sdk'. After all these, you should be okay with the Android SDK errors.

Healion answered 7/4, 2017 at 23:2 Comment(3)
Thanks a lot ! The author should give you the "solutions solved"Scant
Make sure you close or restart your cmd line terminal before running tns doctor againHalmstad
I'm still having this issue... No matter what I try I'm always getting "You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=31'."Oberstone
F
0

https://developer.android.com/studio/index.html

Install the android studio from the above link and then after that run the studio and install the desired android sdk packages from within the studio.

Forgetful answered 27/10, 2016 at 7:13 Comment(3)
I tried this, but it doesn't work. running tns doctor still returns error.Arnaud
You will have to setup the PATH variable to point to the SDK.Forgetful
Look at the answer of @Becky Wu, that works for me !Scant

© 2022 - 2024 — McMap. All rights reserved.