Android framework version
net10.0-android
Affected platform version
Visual Studio 2026 18.9.2, .NET SDK 10.0.400, Microsoft.Android.Sdk.Windows 36.1.69 (aapt2 2.20-13193326), Windows 11 Pro 10.0.26200.2 (not Insider), Dell XPS 16 / Intel Core i9
Description
aapt2.exe crashes with STATUS_ACCESS_VIOLATION (0xc0000005) every single time it is invoked in daemon mode by the Aapt2Compile/_CompileResources MSBuild target, on one specific (otherwise healthy) machine. The build appears to "hang" forever because the MSBuild task never notices the child process died, and just waits for a response that never comes — no error is ever surfaced anywhere in the MSBuild output.
Running the exact same aapt2.exe daemon command manually, interactively, in a normal console window (i.e. NOT spawned by MSBuild/System.Diagnostics.Process with redirected stdio and CreateNoWindow=true) works perfectly — it prints Ready and sits waiting for input, no crash. aapt2.exe version also works fine either way, which rules out a missing dependency (e.g. VC++ runtime) since all statically-declared DLL imports resolve correctly.
Crash details (Event Viewer / WER):
Faulting application name: aapt2.exe, version: 0.0.0.0, time stamp: 0x1f2830d0
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Faulting application path: C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\36.1.69\tools\aapt2.exe
Event Name: BEX64
P7: PCH_xx_FROM_ntdll+0x0000000000161914 (consistent offset across 3 independent runs, only the PCH_xx prefix varies)
P8: c0000005
Report.wer's LoadedModule list at crash time contains ONLY aapt2.exe plus stock Windows system DLLs (ntdll, KERNEL32, KERNELBASE, ucrtbase, SHELL32, msvcp_win, USER32, win32u, GDI32, gdi32full, IMM32, shcore, advapi32, msvcrt, sechost, RPCRT4, CRYPTBASE, bcryptPrimitives) — nothing from any antivirus/EDR/overlay software is loaded, which rules out third-party hooking as the cause.
What was ruled out (none of these changed the outcome):
- Windows Defender exclusions for the project folder, Android SDK folder,
.nuget, .gradle, .android
- Malwarebytes real-time protection fully disabled
- NVIDIA app/GeForce Experience overlay disabled
- Full Clean Boot (msconfig: all non-Microsoft services/startup items disabled, machine rebooted) — crash still 100% reproducible at the identical
ntdll offset
- Windows Security → Exploit Protection → Program settings inspected — only stock Microsoft default entries present, nothing custom targets
dotnet.exe/MSBuild.exe/devenv.exe/aapt2.exe
dotnet workload repair (full repair of android, ios, maccatalyst, maui-windows) — completed successfully, crash persists identically
- Removing a newly-added
MauiImage resource from the project — crash still occurs on the remaining stock app-icon/splash resources
- Not enrolled in the Windows Insider Program
- Killed orphaned
aapt2.exe processes from a previously-cancelled build + rebooted before retrying — no change
- Reproduces identically via plain
dotnet build -f net10.0-android from the command line AND via the Visual Studio 2026 IDE — not VS-IDE-specific
Further narrowing:
- Setting
<Aapt2DaemonMaxInstanceCount>1</Aapt2DaemonMaxInstanceCount> in the .csproj (default allows up to 6 parallel daemon instances) delayed the crash — the build appeared to progress actively for ~70 to ~330 seconds before hitting the identical crash — but did not prevent it.
- Manual interactive
aapt2.exe daemon (own console, not spawned by MSBuild) never crashes, which points at something specific to how Aapt2Daemon launches the process (CreateNoWindow=true, RedirectStandardInput/Output/Error=true, UseShellExecute=false) rather than a bug that triggers in daemon mode unconditionally.
Happy to attach the full .dmp file (available locally under C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_aapt2.exe_...) or run further diagnostics on request.
As a secondary ask: even a fix that makes a crashed daemon child surface as a build error instead of hanging forever would make this whole class of problem far easier to diagnose.
Steps to Reproduce
- .NET MAUI app project,
<TargetFrameworks>net10.0-android</TargetFrameworks>, Microsoft.Maui.Controls 10.0.90.
- Run
dotnet build -f net10.0-android -v detailed (reproduces identically via Visual Studio 2026 Build/Rebuild).
- Build proceeds normally through NuGet restore, Clean, and dozens of MSBuild targets.
- Build reaches
_CompileResources (invokes the Aapt2Compile task).
aapt2.exe is spawned in daemon mode and crashes near-instantly with an access violation (see Event Viewer output above).
- The MSBuild task never detects the child process death and blocks forever — build must be cancelled manually, no error is ever printed.
Did you find any workaround?
No true fix found. Setting <Aapt2DaemonMaxInstanceCount>1</Aapt2DaemonMaxInstanceCount> in the .csproj delays the crash (build runs for ~1-5 minutes before hitting it) but does not prevent it.
Relevant log output
Android framework version
net10.0-android
Affected platform version
Visual Studio 2026 18.9.2, .NET SDK 10.0.400, Microsoft.Android.Sdk.Windows 36.1.69 (aapt2 2.20-13193326), Windows 11 Pro 10.0.26200.2 (not Insider), Dell XPS 16 / Intel Core i9
Description
aapt2.execrashes withSTATUS_ACCESS_VIOLATION(0xc0000005) every single time it is invoked in daemon mode by theAapt2Compile/_CompileResourcesMSBuild target, on one specific (otherwise healthy) machine. The build appears to "hang" forever because the MSBuild task never notices the child process died, and just waits for a response that never comes — no error is ever surfaced anywhere in the MSBuild output.Running the exact same
aapt2.exe daemoncommand manually, interactively, in a normal console window (i.e. NOT spawned by MSBuild/System.Diagnostics.Processwith redirected stdio andCreateNoWindow=true) works perfectly — it printsReadyand sits waiting for input, no crash.aapt2.exe versionalso works fine either way, which rules out a missing dependency (e.g. VC++ runtime) since all statically-declared DLL imports resolve correctly.Crash details (Event Viewer / WER):
Report.wer'sLoadedModulelist at crash time contains ONLY aapt2.exe plus stock Windows system DLLs (ntdll, KERNEL32, KERNELBASE, ucrtbase, SHELL32, msvcp_win, USER32, win32u, GDI32, gdi32full, IMM32, shcore, advapi32, msvcrt, sechost, RPCRT4, CRYPTBASE, bcryptPrimitives) — nothing from any antivirus/EDR/overlay software is loaded, which rules out third-party hooking as the cause.What was ruled out (none of these changed the outcome):
.nuget,.gradle,.androidntdlloffsetdotnet.exe/MSBuild.exe/devenv.exe/aapt2.exedotnet workload repair(full repair ofandroid,ios,maccatalyst,maui-windows) — completed successfully, crash persists identicallyMauiImageresource from the project — crash still occurs on the remaining stock app-icon/splash resourcesaapt2.exeprocesses from a previously-cancelled build + rebooted before retrying — no changedotnet build -f net10.0-androidfrom the command line AND via the Visual Studio 2026 IDE — not VS-IDE-specificFurther narrowing:
<Aapt2DaemonMaxInstanceCount>1</Aapt2DaemonMaxInstanceCount>in the.csproj(default allows up to 6 parallel daemon instances) delayed the crash — the build appeared to progress actively for ~70 to ~330 seconds before hitting the identical crash — but did not prevent it.aapt2.exe daemon(own console, not spawned by MSBuild) never crashes, which points at something specific to howAapt2Daemonlaunches the process (CreateNoWindow=true,RedirectStandardInput/Output/Error=true,UseShellExecute=false) rather than a bug that triggers in daemon mode unconditionally.Happy to attach the full
.dmpfile (available locally underC:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_aapt2.exe_...) or run further diagnostics on request.As a secondary ask: even a fix that makes a crashed daemon child surface as a build error instead of hanging forever would make this whole class of problem far easier to diagnose.
Steps to Reproduce
<TargetFrameworks>net10.0-android</TargetFrameworks>,Microsoft.Maui.Controls10.0.90.dotnet build -f net10.0-android -v detailed(reproduces identically via Visual Studio 2026 Build/Rebuild)._CompileResources(invokes theAapt2Compiletask).aapt2.exeis spawned in daemon mode and crashes near-instantly with an access violation (see Event Viewer output above).Did you find any workaround?
No true fix found. Setting
<Aapt2DaemonMaxInstanceCount>1</Aapt2DaemonMaxInstanceCount>in the .csproj delays the crash (build runs for ~1-5 minutes before hitting it) but does not prevent it.Relevant log output