question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android SDK version 31 is not recognized by cli

See original GitHub issue

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):

  • CLI: 8.1.3
  • Cross-platform modules:
  • Android Runtime:
  • iOS Runtime:
  • XCode Version:
  • Plugin(s):

Describe the bug Android SDK version 31 is installed as default recommended settings for Android Studio. I seem that ns command could not recognize version 31 yet. And the message is bit misleading.

To Reproduce

  1. Follow the Environment setup guide: https://docs.nativescript.org/environment-setup.html#macos-android
  2. Install Android Studio with default recommended settings with Android SDK version 31 and Build-Tools version 31 installed.
  3. Run ns doctor

Warning will be thrown:

✖ Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 28 or later. 
 Run `$ sdkmanager` 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 <=30'. 
 Run `$ sdkmanager` 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. 

Expected behavior

ns doctor should report that:

✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.

Sample project No need to setup a project

Additional context Although, I could not found any official information about supported SDK version on website. I think message “install Android SDK 28 or later.” which ns doctor reported, was bit misleading. Either fix the message and clearly state that SDK 31 is not supported, or we should add support for Android SDK 31 soon?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
daamsiecommented, Feb 7, 2022

@triniwiz Thank you. Might give that a shot later. Considering this is seemingly going to be a stumbling block for anyone following the Environment Setup guide in your docs, perhaps some mention could be made of it there? It took me a fair bit of hunting to find this Github issue. Presumably this will happen every time the versions are out of sync while waiting for an update.

Possibly the most frustrating message I come across in docs (not just yours, but lots of others) is this type of message:

“If you see No issues were detected you have successfully set up your system.”

With 0 hint at what to do if issues were detected.

A link to the troubleshooting section would be appropriate and a mention of this common issue in there and how to deal with it would be perfect. Eg… is there a way to force Android Studio to use version 31? I’m new to this (and I assume many new users of Nativescript / app development are also), so have no idea if that’s possible.

This is just meant as constructive feedback.

0reactions
triniwizcommented, Feb 8, 2022

That check needs some updating because iirc it doesn’t handle the rc releases for those packages

Read more comments on GitHub >

github_iconTop Results From Across the Web

android' is not recognized as an internal or external command
Check if Android SDK and gradle work properly with the terminal commands $ java -version $ android list target $ gradle -v.
Read more >
Command-line tools | Android Developers
Select SDK Location in the left pane. The path is shown under Android SDK location. Set environment variables. We recommend setting the ...
Read more >
How to Fix “Failed to install the following Android SDK ...
Step 1: In Android Studio go to Tools > SDK Manager. Step 2: Go to the SDK Tools tab as shown in the...
Read more >
Installing Android SDK Tools - CodePath Cliffnotes
At the prompt, type android and hit Enter to launch the Android SDK Manager in a window. If this doesn't work, your PATH...
Read more >
How to Install Android Studio and SDK Tools in Windows
If you don't want to use Android Studio and just want the Android SDK command line version, then you'll need to first download...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found