Android SDK version 31 is not recognized by cli
See original GitHub issueEnvironment
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
- Follow the Environment setup guide: https://docs.nativescript.org/environment-setup.html#macos-android
- Install Android Studio with default recommended settings with Android SDK version 31 and Build-Tools version 31 installed.
- 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:
- Created 2 years ago
- Comments:8 (4 by maintainers)
@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.
That check needs some updating because iirc it doesn’t handle the rc releases for those packages