Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
Describe the bug
I configured everything as in getting started guide but when I run 'tns doctor', I have this error message
Getting environment information
TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.
There seem to be issues with your configuration.
โ Getting NativeScript components versions information...
โ Component nativescript has 5.1.0 version and is up to date.
โ Javac is installed and is configured properly.
โ The Java Development Kit (JDK) is installed and is configured properly.
โ Xcode is installed and is configured properly.
โ xcodeproj is installed and is configured properly.
โ CocoaPods are installed.
โ CocoaPods update is not required.
โ CocoaPods are configured properly.
โ Your current CocoaPods version is newer than 1.0.0.
โ Python installed and configured correctly.
โ The Python 'six' package is found.
โ Xcode version 10.1.0 satisfies minimum required version 9.
โ 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 theANDROID_HOMEvariable 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โ WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK
and its dependencies as described in http://developer.android.com/sdk/index.html#Requirementsโ Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 28 or later.
Run$ sdkmanagerto 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 <=28'.
Run$ sdkmanagerfrom your command-line to install requiredAndroid Build Tools. In case you already have them installed, make sureANDROID_HOMEenvironment variable is set correctly.
If I run 'sudo tns doctor', I get
โ Getting environment information
TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.
There seem to be issues with your configuration.
โ Getting NativeScript components versions information...
โ Component nativescript has 5.1.0 version and is up to date.
โ Javac is installed and is configured properly.
โ The Java Development Kit (JDK) is installed and is configured properly.
โ Xcode is installed and is configured properly.
โ xcodeproj is installed and is configured properly.
โ CocoaPods update is not required.
โ Your current CocoaPods version is newer than 1.0.0.
โ Python installed and configured correctly.
โ The Python 'six' package is found.
โ Xcode version 10.1.0 satisfies minimum required version 9.
โ 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 theANDROID_HOMEvariable 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โ WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK
and its dependencies as described in http://developer.android.com/sdk/index.html#Requirementsโ Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 28 or later.
Run$ sdkmanagerto 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 <=28'.
Run$ sdkmanagerfrom your command-line to install requiredAndroid Build Tools. In case you already have them installed, make sureANDROID_HOMEenvironment variable is set correctly.โ WARNING: CocoaPods is not installed or is not configured properly.
You will not be able to build your projects for iOS if they contain plugin with CocoaPod file.
To be able to build such projects, verify that you have installed CocoaPods.
Android SDK is installed with platform v28, build-tools 28.0.3, Android Support Repository v47.0.0, Google Repository v58. I have no problem on building/running native Android and Flutter apps. ANDROID_HOME is also set. I use fish shell and added this to ~/.config/fish/config.fish
set ANDROID_HOME /Users/tuan/Library/Android/sdk
set PATH $ANDROID_HOME $PATH
set PATH $ANDROID_HOME/platform-tools $PATH
set PATH $ANDROID_HOME/tools/bin $PATH
Hi @tuannguyendotme,
We will investigate the issue, I think it is related to fish shell.
I can suggest to set variables as you do for standard shell.
Hi @dtopuzov
Seems it is the integration problem with fish shell. I configured ANDROID_HOME with bash shell (by adding 'export' statements to .bash_profile) and it works fine. After that I switch to fish shell and the problem is gone.
But as I set fish shell is default shell so every time I want to make it works (in fish shell) I need to switch to bash shell then switch back to fish shell.
Hey, guys. I finally know how to solve this problem in fish.
just add -Ux after set command. like this:
set -Ux ANDROID_HOME "/opt/android-sdk"
stack overflow links : set fish env variables.
@Memorytoco
Thank you very much. Works like a charm!!!
Hey guys,
As the issue seems unrelated to NativeScript CLI itself and as you've already found a solution, I'm closing this thread. Feel free to reopen it or log a new one in case you face any other problems with NativeScript CLI used from fish shell.
Happy coding!
Most helpful comment
Hey, guys. I finally know how to solve this problem in fish.
just add
-Uxaftersetcommand. like this:stack overflow links : set fish env variables.