dotnet / dotnet/maui

MAUI incremental build re-executes Android targets on repeat no-change build due to `OutputMissing`

Open
#35,918 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area-tooling platform/android t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

Description

Repeated dotnet build on a .NET MAUI solution (with no source or project changes, and no clean in between) is not behaving like a near no-op.
On the second build, multiple Android-related targets are re-executed because incremental analysis reports OutputMissing for intermediate/stamp outputs.

This suggests an incremental build issue in MAUI Android targets where expected outputs are not preserved or not recognized between consecutive builds.

We work on big, enterprise app which requires about 4 min to build every time we have to start a debug session, even when no changes were made.
This issue seriously impacts our performance

Steps to Reproduce
Steps To Reproduce
  1. Build the solution normally:

    dotnet build EmptyMaui10App.slnx -v:minimal
    
  2. Run the same build again and generate a binlog:

    dotnet build EmptyMaui10App.slnx -v:minimal -bl:repeat-build.binlog
    
  3. Analyze the second build binlog (repeat-build.binlog) with incremental analysis.

Expected Behavior
  • A second build with no file changes should be mostly up-to-date.
  • Compile and Android packaging/stub targets should be skipped unless inputs changed.
Actual Behavior
  • Build succeeds, but many targets still execute in the second run.
  • Incremental analysis summary for second run:
    • Total targets: 1000
    • Skipped (UpToDate): 897
    • Executed: 103
    • Executed reasons:
      • OutputMissing: 102
      • InputNewerThanOutput: 1
Key Re-executed Targets
  • EmptyMaui10App.csproj
    • CoreCompile (OutputMissing)
    • XamlC (OutputMissing)
  • EmptyMaui10App.Droid.csproj
    • _GenerateJavaStubs (OutputMissing)
    • _GeneratePackageManagerJava (OutputMissing)
    • _LinkAssembliesNoShrink (InputNewerThanOutput)
Missing/Stale Outputs Reported
  • obj/Debug/net10.0-android/XamlC.stamp
  • obj/Debug/net10.0-android/stamp/_GenerateJavaStubs.stamp
  • obj/Debug/net10.0-android/stamp/_GeneratePackageManagerJava.stamp
  • CoreCompile-related outputs under obj/bin for net10.0-android

repeat-build.binlog.zip

Optional: Repro Notes

I added #warning lines as markers to detect whether compilation ran.
On the repeated run, only the Android marker warning fired, which aligns with Android-specific targets being re-executed.

Link to public reproduction project repository

https://github.com/rafalka/EmptyMaui10App

Version with bug

10.0.70

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

10.0.70

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the EmptyMaui10App.slnx reproduction and run the two dotnet build commands from the issue, then inspect repeat-build.binlog with incremental analysis. Trace the Android targets reporting OutputMissing, especially _GenerateJavaStubs, _GeneratePackageManagerJava, CoreCompile, and XamlC, along with their listed stamp outputs. Done means a repeat no-change build skips those targets and is mostly up to date.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.