GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — The Android SDK isn't installed or it's not configured properly · Issue #3585 · NativeScript/nativescript-cli

The Android SDK isn't installed or it's not configured properly #3585

New issue
Copy link
New issue
Copy link
Closed
Closed
The Android SDK isn't installed or it's not configured properly#3585
Copy link
Labels
question

Description

@pierreamgabriel
pierreamgabriel
opened on May 15, 2018
Issue body actions

So, I'm definitely moving from Windows 7 to Linux Mint 18.3. I followed all the necessary steps to get NS running as described here https://docs.nativescript.org/start/ns-setup-linux.

When I run tns run android, this is the output:

✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
✖ 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

i'm pretty sure the Android SDK is installed.

Activity

  1. Fatme commented on May 15, 2018

    @Fatme
    Fatme
    on May 15, 2018
    Contributor
    More actions

    Hi @pierremacedo,

    It seems your adb is not included in $PATH. {N} CLI tries to execute $ANDROID_HOME\platform-tools\adb to check if adb is correctly setup. To check it on your side, just execute adb from command line.

    To include it in $PATH you can use

    export PATH=$PATH:$ANDROID_HOME/platform-tools/adb
    
    Reacted by Tamaghna Banerjee, zheu and Max Brückner
  2. pierreamgabriel commented on May 15, 2018

    @pierreamgabriel
    pierreamgabriel
    on May 15, 2018
    Author
    More actions

    @Fatme Thank you but it didn't help and I just found out another problem: NS seems not to recognize the ANDROID_HOME variable set int .bashrc, because as soon as I restart the computer and run tns doctor it tells me the variable isn't set, but it in fact is, since I get this output bash: /home/pierre/android/sdk/: Is a directory when I run $ANDROID_HOME

  3. Fatme commented on May 15, 2018

    @Fatme
    Fatme
    on May 15, 2018
    Contributor
    More actions

    Hi @pierremacedo,

    {N} CLI gets ANDROID_HOME from process environment. There is no logic to check .bashrc or some other profile files.

    process.env["ANDROID_HOME"]
    

    Can you please confirm that you execute tns run command and $ANDROID_HOME from the same terminal?

  4. Fatme commented on May 15, 2018

    @Fatme
    Fatme
    on May 15, 2018
    Contributor
    More actions

    Hi @pierremacedo,

    Another thing we would like to ask you is to execute the following:

    echo $ANDROID_HOME && tns doctor
    
    Reacted by QUINCY HUTCHISON
  5. pierreamgabriel commented on May 15, 2018

    @pierreamgabriel
    pierreamgabriel
    on May 15, 2018
    Author
    More actions

    @Fatme So now the variable and paths are permanently in environment, so no more warnings saying ANDROID_HOME isn't set.

    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/pierre/android/sdk/tools:/home/pierre/android/sdk/platform-tools:/home/pierre/android/sdk/platform-tools/adb"
    
    ANDROID_HOME=/home/pierre/android/sdk/
    

    tns run:

    ✔ Your ANDROID_HOME environment variable is set and points to correct directory.
    ✔ A compatible Android SDK for compilation is found.
    ✔ Javac is installed and is configured properly.
    ✔ The Java Development Kit (JDK) is installed and is configured properly.
    ✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
    ✖ 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 
    

    $ANDROID_HOME:
    bash: /home/pierre/android/sdk/: Is a directory

    echo $ANDROID_HOME && tns doctor:

    /home/pierre/android/sdk/
    ✔ Getting environment information 
    
    ✔ Your ANDROID_HOME environment variable is set and points to correct directory.
    ✔ A compatible Android SDK for compilation is found.
    ✔ Javac is installed and is configured properly.
    ✔ The Java Development Kit (JDK) is installed and is configured properly.
    ✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
    ✖ 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 
    
    There seem to be issues with your configuration.
    ✔ Getting NativeScript components versions information...
    ✔ Component nativescript has 4.0.1 version and is up to date.
    ✔ Component tns-core-modules has 4.0.0 version and is up to date.
    ✖ Component tns-android is not installed.
    ✖ Component tns-ios is not installed.
    ✔ Your ANDROID_HOME environment variable is set and points to correct directory.
    ✔ A compatible Android SDK for compilation is found.
    ✔ Javac is installed and is configured properly.
    ✔ The Java Development Kit (JDK) is installed and is configured properly.
    ✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
    ✖ 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 
    
    
    
  6. Fatme
    added
    question
    on May 16, 2018
  7. Fatme commented on May 16, 2018

    @Fatme
    Fatme
    on May 16, 2018
    Contributor
    More actions

    Hi @pierremacedo,

    I've noticed your $PATH has /home/pierre/android/sdk/tools but it seems you need /home/pierre/android/sdk/tools/bin. Not sure this will resolve your issue but can you please try it:

    export PATH=$PATH:$ANDROID_HOME/tools/bin
    

    After that can you please execute

    adb && tns doctor
    
    Reacted by Ndi-Tah Samweld, Thiago da Silva Pereira and arLevi
    Reacted by Ndi-Tah Samweld
  8. Fatme commented on May 16, 2018

    @Fatme
    Fatme
    on May 16, 2018
    Contributor
    More actions

    Hi @pierremacedo,

    We discussed your problem and actually there are 2 scenarios that might cause this issue.
    The first one is in case when android sdk is not fully installed or configured. To verify it, can you please execute

    ls -la $ANDROID_HOME/platform-tools/adb
    

    The second one is in case when adb server is already running. If this is the case, you need to kill the server. You can use the following:

    $ANDROID_HOME/platform-tools/adb kill-server
    
  9. pierreamgabriel commented on May 17, 2018

    @pierreamgabriel
    pierreamgabriel
    on May 17, 2018
    Author
    More actions

    @Fatme I think it was probably because I was using Linux 32-bit and google doesn't support this architecture but I didn't know that. But now I'm using a 64-bit Debian and I can't even install the required runtime libraries, so I'm definitely giving up on NS and moving to React Native. Thanks for your help.

    Reacted by linoman, Miroslav Maksimovic, Leonardo and Jose F. Lopez
  10. pierreamgabriel
    closed this as completedon May 17, 2018
  11. rosen-vladimirov commented on May 17, 2018

    @rosen-vladimirov
    rosen-vladimirov
    on May 17, 2018
    Contributor
    More actions

    Hey @pierremacedo,
    My name is Rosen Vladimirov and I'm working on NativeScript since its beginning. I'm sorry to hear you have faced issues with the environment configuration and this led you to the decision to stop using the technology. In fact configuring the environment for both iOS and Android builds is not an easy task and as you have seen, we are still struggling with different issues on this side. However, the technology itself, the NativeScript framework, is really powerful. I'm not sure if you were able to give it a try, so I would like to suggest you to take a look at the following resources, which could give you another way to try NativeScript:

    • NativeScript Playground: https://play.nativescript.org - the Playground allows you to try the NativeScript framework with a minimum efforts. You have to download the required application from AppStore (PlayStore) and scan a QR code to deploy your app. In fact NativeScript Playground is the easiest and fastest way to try the technology itself.
    • NativeScript Sidekick: https://www.nativescript.org/nativescript-sidekick - This Desktop application allows you to create, build and run NativeScript applications without any local configuration. The only requirements are to have NativeScript CLI installed and to have a Telerik account. NativeScript Sidekick allows you to use cloud builds (you have 100 free cloud builds each month) and local builds in case your local environment is setup.

    Once again I'm sorry to hear you have faced issues with the configuration. We'll be glad to assist you further in case you would like to give it a try.

  12. IAMtheIAM commented on Aug 2, 2018

    @IAMtheIAM
    IAMtheIAM
    on Aug 2, 2018
    More actions

    If you are switching between platforms like Windows, Linux, and Mac - then you'll need the platform-tools appropriate for each platform aka on windows it is adb.exe and on linux it is adb - so get the platform tools for each platform from here and put them all in the same folder

    As long as ANDROID_HOME points to the root of the sdk folder, it will work.

    Reacted by qwekr and mikecaputozoomcare
  13. divyachandana commented on Oct 15, 2018

    @divyachandana
    divyachandana
    on Oct 15, 2018
    More actions

    updating SDK in AndroidStudio >> Preferences would help
    screen shot 2018-10-16 at 3 25 26 am

  14. WayneDV commented on Dec 30, 2018

    @WayneDV
    WayneDV
    on Dec 30, 2018
    More actions

    I have the same problem, and find that "sudo tns doctor" works fine - even though I installed everything in my non-privileged user's home folder. (SDKs, npm modules, nativescript, etc)

  15. eugenefvdm commented on Feb 23, 2019

    @eugenefvdm
    eugenefvdm
    on Feb 23, 2019
    More actions

    I ran into this problem. I tried following this advice:

    eugene@fintechsystems:/$ ls -la $ANDROID_HOME/platform-tools/adb

    but I get:
    ls: cannot access '~/Android/Sdk/platform-tools/adb': No such file or directory

    Then I skip using the environment variable and specify the hard path:
    eugene@fintechsystems:/$ ls -la /home/eugene/Android/Sdk/platform-tools/adb
    -rwxrwxr-x 1 eugene eugene 2704537 Feb 23 22:37 /home/eugene/Android/Sdk/platform-tools/adb

    That works! Really confused so I changed directory using the environment which also works!

    eugene@fintechsystems:/$ cd /Android/Sdk/platform-tools/
    eugene@fintechsystems:
    /Android/Sdk/platform-tools$ ls -ls adb
    2644 -rwxrwxr-x 1 eugene eugene 2704537 Feb 23 22:37 adb

    So to fix the problem instead of using ~/Android/Sdk I've just hard coded /home/eugene/Android/Sdk and now tns doctor works!

  16. Fatme commented on Feb 23, 2019

    @Fatme
    Fatme
    on Feb 23, 2019
    Contributor
    More actions

    What is the output of echo ~?

  17. eugenefvdm commented on Feb 23, 2019

    @eugenefvdm
    eugenefvdm
    on Feb 23, 2019
    More actions

    eugene@fintechsystems:~$ echo ~
    bash: /home/eugene: Is a directory

  18. zleight1 commented on Jun 28, 2019

    @zleight1
    zleight1
    on Jun 28, 2019
    More actions

    Hopefully this will help someone, on my machine all the Android SDKs/ADB were installed in my /Users folder (probably because I already had Android Studio installed).

    I fixed it by setting the Android home path to point to the /Users/ sdk by running:

    export ANDROID_HOME=/Users/zleighton/Library/Android/sdk

    After that tns doctor reported everything OK.

    Reacted by Igor Caviroski, tlg-265, Don Milham, Jay Borenstein, Vitaliy Stanyshevskyy, Nicholas Gunner, AnderBalles98, Amol Bodhare, Juan Cruz Mendez, Braydon Harris and 3 more
  19. Danielhoifodt commented on Jul 15, 2019

    @Danielhoifodt
    Danielhoifodt
    on Jul 15, 2019
    More actions

    Hi, i can not find the path where sdk and build tools are installed. I think they were installed on a wrong directory. i get the same problems as above. How can i find where sdk is installed?

  20. mahmoudyusof commented on Jan 2, 2020

    @mahmoudyusof
    mahmoudyusof
    on Jan 2, 2020
    More actions

    I also have a problem with sdk configuration. the adb is installed and configured correctly, and I have added all the needed paths to the $PATH env variable, I have no idea what the problem is
    here is the output of $ tns doctor

    ✔ Getting environment information 
    
    There seem to be issues with your configuration.
    ✔ Getting NativeScript components versions information...
    ✔ Component nativescript has 6.3.0 version and is up to date.
    ✔ Your ANDROID_HOME environment variable is set and points to correct directory.
    ✔ Your adb from the Android SDK is correctly installed.
    ✔ A compatible Android SDK for compilation is found.
    ✔ Javac is installed and is configured properly.
    ✔ The Java Development Kit (JDK) is installed and is configured properly.
    ✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
    ✖ 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 
    
    You are missing the nativescript-cloud extension and you will not be able to execute cloud builds. Your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options:  
    Select "Sync to Playground" to enjoy NativeScript without any local setup. All you need is a couple of companion apps installed on your devices.
    Select "Configure for Cloud Builds" to install the nativescript-cloud extension and automatically configure your environment for cloud builds.
    Select "Configure for Local Builds" to run the setup script and automatically configure your environment for local builds.
    Select "Configure for Both Local and Cloud Builds" to automatically configure your environment for both options.
    Select "Configure for Both Local and Cloud Builds" to automatically configure your environment for both options.
    

    here are the edits I made to my ~/.bashrc file as well.

    export JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')
    
    export ANDROID_HOME="/usr/local/android/sdk"
    
    export PATH="$PATH:$ANDROID_HOME/tools/:$ANDROID_HOME/platform-tools/:$ANDROID_HOME/tools/bin"
    
    Reacted by Artur Kurowski, Wojciech Tomczyk and adambeck7
  21. gabrielg-dev commented on Feb 10, 2020

    @gabrielg-dev
    gabrielg-dev
    on Feb 10, 2020
    More actions

    I have another nativescript project on same pc and that run without problem, but nativescript-oauth2 github angular example show always "The setup script was not able to configure your environment for local builds"

    Update (edit):

    I just installed sdk build tools 29.0.3, 28.0.3 and 27.0.3 using sdkmanager and now it works.

  22. gajanannaik commented on Jun 30, 2020

    @gajanannaik
    gajanannaik
    on Jun 30, 2020
    More actions

    s1
    When i tried to run tns doctor i got this error help me please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.