[ci-scan-net11] Essentials Android device tests fail to compile after Activity API changes
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 290
Description
## Summary
The Essentials Android device-test project fails to compile because `ActivityFlags` is ambiguous and `TaskInfo.TaskId` is used below its supported API level.
## Build Information
- **Pipeline**: maui-pr
- **Build**: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1593652
- **Build ID**: 1593652
- **Branch**: net11.0
- **First seen**: 2026-09-11
- **Occurrences**: 1 in last 10 builds
## Affected Legs
- Build macOS (Debug and Release)
- Build Windows (Debug and Release)
- Target framework: net11.0-android
## Error Message
```text
2026-09-11T22:50:39.0865800Z /Users/cloudtest/vss/_work/1/s/src/Essentials/test/DeviceTests/Tests/ActivityStateManagerRecreation_Tests.Android.cs(153,15): error CS0104: 'ActivityFlags' is an ambiguous reference between 'AndroidX.Activity.ActivityFlags' and 'Android.Content.ActivityFlags' [/Users/cloudtest/vss/_work/1/s/src/Essentials/test/DeviceTests/Essentials.DeviceTests.csproj::TargetFramework=net11.0-android]
2026-09-11T22:50:39.0866720Z /Users/cloudtest/vss/_work/1/s/src/Essentials/test/DeviceTests/Tests/ActivityStateManagerRecreation_Tests.Android.cs(199,25): error CA1416: This call site is reachable on: 'Android' 24.0 and later. 'TaskInfo.TaskId' is only supported on: 'android' 29.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416) [/Users/cloudtest/vss/_work/1/s/src/Essentials/test/DeviceTests/Essentials.DeviceTests.csproj::TargetFramework=net11.0-android]
```
## Investigation Context
Both compiler diagnostics originate in `ActivityStateManagerRecreation_Tests.Android.cs` and repeat across four main-build legs. The device-test pipeline carries the same source-level failure, indicating a shared Android test compilation break rather than a test execution failure.
Contributor guide
Research direction
Start with src/Essentials/test/DeviceTests/Tests/ActivityStateManagerRecreation_Tests.Android.cs at the reported lines 153 and 199, then run the Essentials Android device-test build for net11.0-android. Check the Android API annotations and the conflicting ActivityFlags references. Done means the project compiles without CS0104 or CA1416 across the listed macOS and Windows Debug and Release legs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, csharp
- Domain
- mobile-dev, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100