Uh oh!
There was an error while loading. Please reload this page.
Error when Mono-specific AOT settings are enabled with CoreCLR - #11246
Conversation
Agent-Logs-Url: https://github.com/dotnet/android/sessions/5dc84843-14bd-46ed-a820-7463318a90bb Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/android/sessions/5dc84843-14bd-46ed-a820-7463318a90bb Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
simonrozsival
left a comment
There was a problem hiding this comment.
@copilot let's keep the existing codes, but only change the warnings to errors.
Agent-Logs-Url: https://github.com/dotnet/android/sessions/f5434cce-5a43-458d-a2c2-dc045e23f5b7 Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR improves runtime-property validation in the Android MSBuild targets so Mono-specific AOT settings don’t silently apply to CoreCLR builds and fail later in the pipeline, by emitting an early XA1044 build error and updating tests accordingly.
Changes:
- Convert XA1044 diagnostics for
RunAOTCompilation/EnableLLVMincompatibility into build-stopping errors. - Keep rejecting Mono-specific AOT properties when
$(_AndroidRuntime) != MonoVM(and reset them), but now fail the build immediately. - Update CoreCLR-focused AOT tests to expect XA1044 errors and build failure.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets | Switch XA1044 from AndroidWarning to AndroidError in _CheckNonIdealAppConfigurations to fail builds early. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs | Update CoreCLR AOT-related tests to assert build failures and check for error XA1044. |
| src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets | Update comment to reflect error behavior while continuing to set XA1044 flags and reset incompatible properties. |
Uh oh!
There was an error while loading. Please reload this page.
simonrozsival
commented
Apr 29, 2026
@copilot the I believe we should parametrize the test to build both with Mono and with CoreCLR and to set |
Agent-Logs-Url: https://github.com/dotnet/android/sessions/bf9785cc-3f38-4654-bbbf-253bc2e1c20a Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/android/sessions/94982e01-ea26-457f-a092-0a1a1da4a801 Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
RunAOTCompilation=truewas still enabling MonoAOT for CoreCLR builds, causingmono-aot-crossto fail later with a runtime-critical type error. CoreCLR builds should reject Mono-specific AOT settings early with an actionable MSBuild error.Runtime property validation
RunAOTCompilation=truewhen the selected Android runtime is notMonoVM.EnableLLVM=truewhen the selected Android runtime is notMonoVM.MSBuild error
XA1044code for incompatible Mono-specific properties used with non-Mono runtimes.XA1044diagnostics from warnings to errors.Test coverage
XA1044instead of successful builds withXA1044warnings.