Summary
AOTTemplateTest.PublishNativeAOTRootAllMauiAssemblies and AOTTemplateTest.PublishNativeAOT integration tests fail on iOS and macCatalyst because the ILC (Native AOT compiler) generates unexpected IL3050 warning files for HybridWebViewHandler.WebViewScriptMessageHandler and SchemeHandler, which are not in the expected warnings baseline.
Build Information
- Pipeline: maui-pr (ID 302)
- Build: 1446270 (latest)
- Branch: net11.0
- First seen: 2026-05-13 (build 1413742)
- Occurrences: 12 in last 15 builds
Affected Legs
AOT macOS — net11.0-maccatalyst maccatalyst-arm64
AOT macOS — net11.0-maccatalyst maccatalyst-x64
AOT macOS — net11.0-ios iossimulator-x64
AOT macOS — net11.0-ios iossimulator-arm64
AOT macOS — net11.0-ios ios-arm64
Error Message
[xUnit.net] Microsoft.Maui.IntegrationTests.AOTTemplateTest.PublishNativeAOTRootAllMauiAssemblies
(id: "maui", framework: "net11.0-maccatalyst", runtimeIdentifier: "maccatalyst-arm64") [FAIL]
Error Message:
Unexpected warning files detected! Unexpected warning file paths are: ILC
ILC : AOT analysis warning IL3050: <Module>..cctor(): Using member
'Microsoft.Maui.Handlers.HybridWebViewHandler.WebViewScriptMessageHandler..cctor()'
which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling.
HybridWebView uses dynamic System.Text.Json serialization features.
ILC : AOT analysis warning IL3050: <Module>..cctor(): Using member
'Microsoft.Maui.Handlers.HybridWebViewHandler.SchemeHandler..cctor()'
which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling.
HybridWebView uses dynamic System.Text.Json serialization features.
Also failing with unexpected apply-preserve-attribute.xml linker-cache file:
Unexpected warning files detected! Unexpected warning file paths are:
obj/Release/net11.0-maccatalyst/maccatalyst-arm64/linker-cache/apply-preserve-attribute.xml
Recommended Action
The inner types WebViewScriptMessageHandler and SchemeHandler inside HybridWebViewHandler (iOS/macCatalyst platform code under src/Core/src/Handlers/HybridWebView/) carry [RequiresDynamicCode] because they use dynamic System.Text.Json serialization. Their static constructors are reached unconditionally by the ILC, producing unexpected IL3050 warning files that are not in the AOT test baseline.
Options:
- Preferred: Migrate
HybridWebViewHandler JSON serialization to source-generated System.Text.Json to remove the [RequiresDynamicCode] attribute entirely
- Add the new ILC warning files to the AOT test expected-warnings baseline as a short-term workaround
Related: issue #34867 (same root cause on Android variant)
Generated by CI Failure Scanner (net11.0) · ● 51M · ◷
Summary
AOTTemplateTest.PublishNativeAOTRootAllMauiAssembliesandAOTTemplateTest.PublishNativeAOTintegration tests fail on iOS and macCatalyst because the ILC (Native AOT compiler) generates unexpected IL3050 warning files forHybridWebViewHandler.WebViewScriptMessageHandlerandSchemeHandler, which are not in the expected warnings baseline.Build Information
Affected Legs
AOT macOS— net11.0-maccatalyst maccatalyst-arm64AOT macOS— net11.0-maccatalyst maccatalyst-x64AOT macOS— net11.0-ios iossimulator-x64AOT macOS— net11.0-ios iossimulator-arm64AOT macOS— net11.0-ios ios-arm64Error Message
Also failing with unexpected
apply-preserve-attribute.xmllinker-cache file:Recommended Action
The inner types
WebViewScriptMessageHandlerandSchemeHandlerinsideHybridWebViewHandler(iOS/macCatalyst platform code undersrc/Core/src/Handlers/HybridWebView/) carry[RequiresDynamicCode]because they use dynamicSystem.Text.Jsonserialization. Their static constructors are reached unconditionally by the ILC, producing unexpected IL3050 warning files that are not in the AOT test baseline.Options:
HybridWebViewHandlerJSON serialization to source-generatedSystem.Text.Jsonto remove the[RequiresDynamicCode]attribute entirelyRelated: issue #34867 (same root cause on Android variant)