Skip to content

AOT integration tests fail: unexpected IL3050 warnings for HybridWebViewHandler #34867

Description

@PureWeen

Description

The PublishNativeAOTRootAllMauiAssemblies and PublishNativeAOT integration tests fail on Android (net11.0-android) because the expected warnings baseline doesn't include new IL3050 warnings from HybridWebViewHandler.

Error

Unexpected warning messages detected for the expected warnings file path 'ILC' and warning code 'IL3050'!
Unexpected warning messages are:
  Microsoft.Maui.Controls.Hosting.AppHostBuilderExtensions.AddControlsHandlers(IMauiHandlersCollection):
    Using member 'Microsoft.Maui.Handlers.HybridWebViewHandler.HybridWebViewHandler()' which has
    'RequiresDynamicCodeAttribute' can break functionality when AOT compiling.
    HybridWebView uses dynamic System.Text.Json serialization features.

  Microsoft.Maui.Controls.Hosting.AppHostBuilderExtensions.AddControlsHandlers(IMauiHandlersCollection):
    Using member 'Microsoft.Maui.Handlers.HybridWebViewHandler.HybridWebViewHandler(IPropertyMapper,CommandMapper)'
    which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling.
    HybridWebView uses dynamic System.Text.Json serialization features.

Affected Tests

  • AOTTemplateTest.PublishNativeAOTRootAllMauiAssemblies (android-x64, android-arm64)
  • AOTTemplateTest.PublishNativeAOT (android-x64, android-arm64)

Fails on both Windows and macOS AOT integration test jobs.

Repro

Observed on release/11.0.1xx-preview3 and net11.0 branches with Android SDK 36.99.0-preview.3.10.

Expected Fix

Update the expected warnings baseline in the AOT integration tests to include these IL3050 warnings for HybridWebViewHandler, or suppress the warning on the HybridWebViewHandler constructors.

Metadata

Metadata

Labels

s/triagedIssue has been reviewed

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions