dotnet / dotnet/android

NativeAOT publish fails when AsyncHelpers.RestoreInlinedFrameContexts is missing

Open
#12,486 1 comment 1 reaction 2 assignees Claimed by @simonrozsival View on GitHub
needs-triage
Dominant language
C#
Stars
2.1k
Forks
579
Avg merge
1d 21h
Merged PRs (30d)
257

Description

### Description

MAUI Android NativeAOT publishing fails consistently because ILCompiler expects `System.Runtime.CompilerServices.AsyncHelpers.RestoreInlinedFrameContexts`, but the method is absent from the supplied `System.Private.CoreLib`.

The failure reproduces on both Pixel8 and GalaxyA16 legs in two consecutive `dotnet/performance` CI builds.

### Error

```text
ILCompiler.CodeGenerationFailedException: Code generation failed for method
'Async variant: [System.Private.CoreLib]System.IO.FileStream.DisposeAsync()'

System.InvalidOperationException: Expected method 'RestoreInlinedFrameContexts' not found on type
'[System.Private.CoreLib]System.Runtime.CompilerServices.AsyncHelpers'
```

The subsequent `dotnet publish` command exits with code 1 for `net11.0-android`, `android-arm64`, with:

```text
/p:UseMonoRuntime=false
/p:PublishAot=true
```

### Affected builds

- [Build 3055401 — Pixel8](https://dev.azure.com/dnceng/internal/_build/results?buildId=3055401&view=logs&j=da43aa19-6365-5aff-954c-402021c3da8f)
- [Build 3055401 — GalaxyA16](https://dev.azure.com/dnceng/internal/_build/results?buildId=3055401&view=logs&j=4614199a-6532-53bc-3f2a-5d6f20b1b0e9)
- [Build 3055211 — Pixel8](https://dev.azure.com/dnceng/internal/_build/results?buildId=3055211&view=logs&j=da43aa19-6365-5aff-954c-402021c3da8f)
- [Build 3055211 — GalaxyA16](https://dev.azure.com/dnceng/internal/_build/results?buildId=3055211&view=logs&j=4614199a-6532-53bc-3f2a-5d6f20b1b0e9)

### Versions

- Target framework: `net11.0-android`
- Runtime identifier: `android-arm64`
- Android workload: `37.0.0-rc.2.2294`
- ILCompiler/runtime package: `11.0.0-rc.2.26422.106`
- MAUI workload: `11.0.0-preview.7.26418.6`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.