-
Notifications
You must be signed in to change notification settings - Fork 555
Description
Android application type
.NET Android (net7.0-android, etc.)
Affected platform version
All
Description
I just did a fresh install of VS Code and tried to build an Android app. I followed the instructions to set up Java and the Android SDK. VSCode can build the app, but dotnet build
does not.
It fails because it can't find the sdk because I have not set AndroidSdkDirectory
. I never set that for builds when using full VS.
I tried setting the correct ANDROID_SDK_ROOT and ANDROID_HOME envvars, but nothing changes.
The output of dotnet build -t:InstallAndroidDependencies -f:net8.0-android
also does not say anything. It would be nice if the SDK could be automatically picked up using the default/accepted envvars and not require a .NET-specific setting.
Steps to Reproduce
- Clean VS/Sandbox
- Install MAUI Dev Kit
- Install Java and Android SDK following the directions
- Run
dotnet build
- Observe the error
- Run using F5
- Observe no error
Did you find any workaround?
Setting an envvar AndroidSdkDirectory
to my SDK. This is not really expected and no mention in the docs. I just know to set it because I know MSBuild also checks envvars.
Relevant log output
No response