Skip to content

Android workload not recognized on Windows #10071

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

Open
viniciusjarina opened this issue Apr 23, 2025 · 5 comments
Open

Android workload not recognized on Windows #10071

viniciusjarina opened this issue Apr 23, 2025 · 5 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects.

Comments

@viniciusjarina
Copy link

Android framework version

net10.0-android (Preview)

Affected platform version

.NET 10.0.100-preview.3.25201.16

Description

I bumped .NET SDK to preview 3 on my CI 10.0.100-preview.3.25201.16

When I try to build an Android library it complains:

##[error]C:\hostedtoolcache\windows\dotnet\sdk\10.0.100-preview.3.25201.16\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): Error NETSDK1147: To build this project, the following workloads must be installed: android-net8

Then I added dotnet workload install android-net8

And workload install doesn't recognize android-net8.

Workload installation failed: Workload ID android-net8 is not recognized.

Is there any reason why add a totally new workload instead of simply update the android workload ?

Steps to Reproduce

Build an Android project on Windows with .NET 10 preview 3

Did you find any workaround?

Use .NET 9

Relevant log output

@viniciusjarina viniciusjarina added the needs-triage Issues that need to be assigned. label Apr 23, 2025
@jpobst
Copy link
Contributor

jpobst commented Apr 23, 2025

What TargetFramework are you trying to build?

@jpobst jpobst added Area: App+Library Build Issues when building Library projects or Application projects. and removed needs-triage Issues that need to be assigned. labels Apr 23, 2025
@viniciusjarina
Copy link
Author

What TargetFramework are you trying to build?

<TargetFramework>net8.0-android</TargetFramework>

@jpobst
Copy link
Contributor

jpobst commented Apr 23, 2025

The "official" answer is Android .NET N only supports one back (.NET N - 1). For example, .NET 9 can only target net9.0-android and net8.0-android. It does not support net7.0-android.

You should get a nice error message about how net8.0-android is not supported.

However, we had a unique requirement this time for new NativeAOT preview packages. We need to build all the AndroidX/etc NuGet packages we maintain with both net8.0-android for our currently supported users and net10.0-android previews because only .NET 10 assemblies will work with our NativeAOT preview work.

So for now we have temporarily allowed .NET 10 to build net8.0-android with an explicit android-net8 workload. This will be removed before .NET 10 RTM.

But the real answer is net8.0-android isn't (and won't be) supported in .NET 10.

@viniciusjarina
Copy link
Author

Thank you for your explanation @jpobst . I thought .NET N(LTS) would be compatible with the previous LTS. Since .NET 8 will be supported until Nov/2026.

Image

I will revert my C.I to use .NET 9.

@jpobst
Copy link
Contributor

jpobst commented Apr 24, 2025

MAUI and the other mobile workloads (like .NET for Android) do not have LTS versions:
https://dotnet.microsoft.com/en-us/platform/support/policy/maui

.NET 8 MAUI/Mobile will go out of support on May 14, 2025.

That is why we will not support building net8.0-android from .NET 10 when it is released in Nov 2025.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Projects
None yet
Development

No branches or pull requests

3 participants