dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.92k stars 526 forks source link

[Xamarin.Android.Build.Tasks] fix `<GenerateRtxt/>` during design-time builds #9288

Closed jonathanpeppers closed 1 week ago

jonathanpeppers commented 2 weeks ago

Fixes: https://github.com/dotnet/android/issues/9285

Building a .NET 9 project without API 35 installed would fail with:

MSB4044: The "GenerateRtxt" task was not given a value for the required parameter "JavaPlatformJarPath"

I was able to reproduce this in an MSBuild test that uses:

var androidSdkPath = CreateFauxAndroidSdkDirectory (Path.Combine (path, "android-sdk"), "35.0.0", []);

To fix this:

I also did some other cleanup: