Skip to content

See if we can avoid XA5207 for design-time builds #7405

Closed
@jonathanpeppers

Description

@jonathanpeppers

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

.NET 6

Description

A design-time build in Visual Studio can hit:

Error    XA5207    Could not find android.jar for API level 31. This means the Android SDK platform for API level 31 is not installed. Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the Xamarin.Android project to target an API version that is installed. (C:\Program Files (x86)\Android\android-sdk\platforms\android-31\android.jar missing.) 

This is a problem because they only run the auto-sdk installer in VS, when you have the Android target framework selected. By default Windows is selected, but a design-time build runs for all TargetFrameworks.

Let's just see if we can avoid this target in design-time builds?

Steps to Reproduce

Open a .NET 6 MAUI app in VS, when you only have API 33 installed.

Did you find any workaround?

Install API 31

Relevant log output

No response

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions