nativescript-cli: NativeScript 1.6 Problem, please take a look :)

From @wisonye on February 25, 2016 2:48

  1. Install issue, my NativeScript 1.5 was fine, when I do update or re-install nativescript 1.6, it show this error( should call “tips” ? ), I use “sudo npm install -g nativescript”, and actually my $ANDROID_HOME works fine, “$ANDROID_HOME/tools/android” can show the “Android SDK Manager” and all SDK works fine and AVD works fine, do you think that’s bug ?
> nativescript@1.6.1 postinstall /usr/local/lib/node_modules/nativescript
> node postinstall.js

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

TIP: To avoid setting up the necessary environment variables, you can use the Homebrew 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 Homebrew package manager to install the Android SDK and its dependencies.

Verifying CocoaPods. This may take more than a minute, please be patient.
npm ERR! registry error parsing json
WARNING: There was a problem with CocoaPods
Verify that CocoaPods are configured properly.
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: '>=22 <=23'.
Run android 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 $ android  to manage the Android Support Repository. In case you already have it installed, make sure ANDROID_HOME environment variable is set correctly.

and what problem is this ???

Verifying CocoaPods. This may take more than a minute, please be patient.
npm ERR! registry error parsing json
WARNING: There was a problem with CocoaPods

Copied from original issue: NativeScript/NativeScript#1640

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

Guys, here is my fix on Ubuntu 16.04.3 LTS. step 1. Add the below to the .bash_profile(create if you don’t have it):

export JAVA_HOME=/usr/lib/jvm/java-8-oracle/ export ANDROID_HOME=/home/(your user)/Android/Sdk export PATH=${PATH}:/home/(your user)/Android/Sdk/platform-tools:/home/(your user)/Android/Sdk/tools:/home/(your user)/Android/Sdk/tools/bin

at the end ==> $ source ~/.bash_profile

step 2. Install the latest version of build-tools in my case it’s v.27

sudo $ANDROID_HOME/tools/bin/sdkmanager "tools" "platform-tools" "platforms;android-27" "build-tools;27.0.1" "extras;android;m2repository" "extras;google;m2repository"

step3. In android studio open SDK manager and install all packages in SDK Tools (except google play)

After all aforementioned I got this:

`user@user:~$ tns doctor 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.

Your components are up-to-date: nativescript,tns-core-modules,tns-android,tns-ios

No issues were detected.`

@wisonye @enchev I have this problem, too. How did you solve it? I use Linux.