Skip to content

Android SDK version 31 is not recognized by cli #5589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
minhnhut opened this issue Oct 8, 2021 · 8 comments · Fixed by NativeScript/nativescript-doctor#71 or #5590
Closed

Android SDK version 31 is not recognized by cli #5589

minhnhut opened this issue Oct 8, 2021 · 8 comments · Fixed by NativeScript/nativescript-doctor#71 or #5590

Comments

@minhnhut
Copy link

minhnhut commented Oct 8, 2021

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?

@daamsie
Copy link

daamsie commented Feb 4, 2022

Heads up, I just tried the setup and get the same problem, but it's related to version 32.

@triniwiz
Copy link
Member

triniwiz commented Feb 4, 2022

@daamsie you can use version 32 but you will need to install the @next version of the cli along with @alpha version of the runtime

@daamsie
Copy link

daamsie commented 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.

@triniwiz
Copy link
Member

triniwiz commented Feb 7, 2022

@daamsie Yes we can add some troubleshooting guides in there but those versions which are currently (alpha & next) are to be released as 8.2. I wanted to ensure things were stable before recommending trying this out.

@daamsie
Copy link

daamsie commented Feb 8, 2022

@triniwiz Makes total sense. The problem will happen again when there is a version 33 of Android SDK though I'm guessing right? So it seems anyone onboarding during these version mismatch periods will have a broken experience.

@triniwiz
Copy link
Member

triniwiz commented Feb 8, 2022 via email

@daamsie
Copy link

daamsie commented Feb 8, 2022

keep in mind that this only happened for build tools 31

To be clear, I'm having this problem with version 32

It seems in the code you basically have to add the newly supported version every time one is released (presumably after running some tests). I don't know what Android's upgrade cycle is like, but it seems like it was 3 months between versions 31 and 32 being released based on the date of this issue. So assuming that is their cycle, you could roughly expect this problem every 3 months right?

Of course I might be wildly misunderstanding the problem, in which case please ignore me.

@triniwiz
Copy link
Member

triniwiz commented Feb 8, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants