Context: https://github.com/xamarin/xamarin-android/issues/8413
Context: https://github.com/xamarin/xamarin-android/issues/8522
The [XA5207][0] error message contained IDE-specific instructions:
# Visual Studio
error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed.
Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change your Xamarin.Android project
to target an API version that is installed.
# Visual Studio for Mac
error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed.
Either install it in the Android SDK Manager (Tools > Open Android SDK Manager...), or change your Xamarin.Android project
to target an API version that is installed.
[Visual Studio for Mac is now deprecated][1]:
> Visual Studio for Mac is scheduled for retirement by August 31, 2024
Visual Studio Code is now supported, via [C# Dev Kit][2] and the
[.NET MAUI][3] extensions. ([Announcement][4].)
These changes mean that our error messages are obsolete (building on
macOS) or misleading (building within VSCode on Windows).
Update the XA5207 error generation logic to take these changes into
consideration. Visual Studio (Windows) will retain the existing
error message text. The Visual Studio for Mac instructions are
replaced with instructions for command-line builds, for use from
Visual Studio Code:
# Visual Studio
error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed;
it was expected to be in `…`.
Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the .NET Android project
to target an API version that is installed.
See https://aka.ms/xa5207 for more details.
# Visual Studio Code
error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed;
it was expected to be in `…`.
You can install the missing API level by running
`dotnet build -t:InstallAndroidDependencies -f net8.0-android "-p:AndroidSdkDirectory=…"`,
or change the project to target an API version that is installed.
See https://aka.ms/xa5207 for more details.
Update some of the documentation around the
`InstallAndroidDependencies` target to mention `dotnet build` options
which are required in order for the target to function correctly.
Finally, update various error messages, replacing "Xamarin.Android"
with ".NET Android".
[0]: 40cc8eaf78/Documentation/guides/messages/xa5207.md
[1]: https://learn.microsoft.com/en-us/visualstudio/mac/what-happened-to-vs-for-mac?view=vsmac-2022
[2]: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit
[3]: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-maui
[4]: https://devblogs.microsoft.com/visualstudio/announcing-the-dotnet-maui-extension-for-visual-studio-code/