I always get the same message in Visual Studio Code when I create a new .NET MAUI app: Android SDK: Install required
ACTION REQUIRED:
- The required Android SDK components need to be installed. You can install them from the command palette by choosing ‘.NET MAUI:
Configure Android’, selecting ‘How to configure Android’, and
following the instructions. Take into account that the Maui Android
SDK recommends specific component versions and if you decide to not
use them the build/debug may not work well.- Another option is to use the Android SDK Manager tool from Visual Studio to install the Android Sdk components.
- Alternatively, you can try installing the components by opening a Terminal, navigating to directory
‘/Users/name/Library/Developer/Xamarin/android-sdk-macosx/cmdline-tools/7.0/bin’
and then running: ‘sdkmanager "build-tools;34.0.0"’. Licenses needs
to be accepted running: ‘sdkmanager –licenses –verbose’. After that,
please verify if the android-sdk-license file exist into the licenses
directory on
‘/Users/name/Library/Developer/Xamarin/android-sdk-macosx’. If this
keeps failing, please try deleting the licenses folder and accepting
the licenses again.
I have tried to install the Android SDK in Visual Studio Code but it was still not working.
Then I created a new .NET Maui app in Visual Studio for Mac and the Android SDK was automatically installed and the app was running on my Android tablet. After that I opened the folder of this app in Visual Studio Code but then I still get the same message Android SDK: Install required.
Why is the Android SDK not working in Visual Studio Code? I use macOS Sonoma 14.2 and I have an Intel iMac.
UPDATE:
I installed the Android SDK in Visual Studio for Mac. The following things are installed in Visual Studio for Mac:
But I still get the same error in Visual Studio Code when I open my Android project in Visual Studio Code. Why is my Android project not working in Visual Studio Code?
Java SDK path to be used: /Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home
Android SDK path to be used: /Users/name/Library/Developer/Xamarin/android-sdk-macosx
Android components:
– Java SDK (version: ‘11.0.21’): installed.
Android SDK recommended required components:
- platforms/android-34 (version: '2'): installed.
x build-tools/34.0.0: not installed.
- platform-tools (version: '34.0.5'): installed.
- cmdline-tools/11.0 (version: '11.0'): installed.
Android SDK recommended optional components:
- emulator (version: '33.1.24'): installed.
x system-images/android-34/google_apis/x86_64: not installed.
- system-images/android-31/google_apis/x86_64 (version: '12'): installed.
- system-images/android-28/google_apis_playstore/x86 (version: '1'): installed.
- system-images/android-29/google_apis_playstore/x86 (version: '8'): installed.
ACTION REQUIRED:
– The required Android SDK components need to be installed. You can install them from the command palette by choosing ‘.NET MAUI: Configure Android’, selecting ‘How to configure Android’, and following the instructions. Take into account that the Maui Android SDK recommends specific component versions and if you decide to not use them the build/debug may not work well.
– Another option is to use the Android SDK Manager tool from Visual Studio to install the Android Sdk components.
– Alternatively, you can try installing the components by opening a Terminal, navigating to directory ‘/Users/name/Library/Developer/Xamarin/android-sdk-macosx/cmdline-tools/7.0/bin’ and then running: ‘sdkmanager "build-tools;34.0.0"’.
Licenses needs to be accepted running: ‘sdkmanager –licenses –verbose’. After that, please verify if the android-sdk-license file exist into the licenses directory on ‘/Users/name/Library/Developer/Xamarin/android-sdk-macosx’. If this keeps failing, please try deleting the licenses folder and accepting the licenses again.
OPTIONAL:
– There are optional recommended Android SDK components that can be installed/upgraded. You can install it from the command palette by choosing ‘.NET MAUI: Configure Android’, selecting ‘How to configure Android’, and following the instructions.
– Another option is to use the Android SDK Manager tool from Visual Studio to install the Android Sdk components.
– Alternatively, you can try installing the components by opening a Terminal, navigating to directory ‘/Users/name/Library/Developer/Xamarin/android-sdk-macosx/cmdline-tools/7.0/bin’ and then running: ‘sdkmanager "system-images;android-34;google_apis;x86_64"’.
Licenses needs to be accepted running: ‘sdkmanager –licenses –verbose’. After that, please verify if the android-sdk-license file exist into the licenses directory on ‘/Users/name/Library/Developer/Xamarin/android-sdk-macosx’. If this keeps failing, please try deleting the licenses folder and accepting the licenses again.
2
Answers
For this, you can follow document: Setting up the Android SDK for Xamarin.Android.
Visual Studio includes an Android SDK Manager that you use to download Android SDK tools, platforms, and other components that you need for developing
Xamarin.Android
apps.And the Xamarin Android SDK Manager (installed as part of the Mobile development with .NET workload) helps you download the latest Android components that you need for developing your
Xamarin.Android
app.I am facing a similar issue when checking the health of my Android SDK on VS Code. You can find the details on this post:
Set up VS Code environment for MAUI .NET 8 – Android
Notice that I can normally build and deploy on emulator on VS for Mac 2022 in .NET 7 Maui solution. Unfortunately, though, I still get those warnings when trying to install the remaining Android SDKs.