Skip to content

[HR][Android] C# edits to an MVUX model are reported applied, but the app keeps running the old code #25417

Open

Description

@kazo0

Current behavior

On Android (emulator, API 36, Debug, Mono interpreter), a body-only edit to a model method:

  • is reported applied by both sides (server op Success, app op Success, types MainModel);
  • has no effect: the old code keeps running, and the page is not recreated.

The same edit on Skia desktop recreates the page and runs the new code.

Step Desktop Android
Click +1 before any edit 0 → 1 0 → 1
Edit c => c + 1 to c + 10; status applied applied
Click 0 → 10 (page recreated) 1 → 2
Edit to c + 100; status applied applied
Click 0 → 100 2 → 3

It isn't specific to lambdas. Making the lambda call static int Delta() => 1; and editing Delta to return 10 gives the same result on Android: reported applied, the click still adds 1.

Edits to XAML do apply on Android: a TextBlock.Text change showed on the device right away.

Expected behavior

The edit takes effect as it does on desktop, or Hot Reload reports that it did not apply.

The false "applied" is the worse half of this. An agent or a developer reads it as success and then debugs their own code.

Notes

  • The app logs TypeFromPath - Navigation failed: Could not resolve type for path 'MainModel#1' (Uno.Extensions.Navigation.MappedRouteResolver) at the moment of the edit. The desktop app logs the same warning and still applies the edit, so it is probably not the cause.
  • The emulator has no debug.mono.env property set, and the app's baked environment has no DOTNET_MODIFIABLE_ASSEMBLIES. On the other hand, a Mono crash seen in another run, inside mono_image_load_enc_delta, shows that deltas do reach the runtime. Worth checking whether the delta is applied to the runtime at all, and whether the page-update step after it runs on Android.
  • Possibly related: [HR][MVUX][Logging] Hot Reload does not apply code changes for ILogger in Mvux Model #21691 (MVUX model code changes not applied by Hot Reload).

How to reproduce

On an app created from the recommended preset (MVUX, Navigation), with public async ValueTask Increment(CancellationToken ct) => await Count.UpdateAsync(c => c + 1, ct); bound to a button:

  1. Run the Android target on an emulator under the DevServer and click +1 (0 → 1).
  2. Change c + 1 to c + 10 and save; Hot Reload reports it applied.
  3. Click +1: the count goes up by 1, not 10.

Running the same steps on the desktop target gives +10.

Environment

  • Uno.WinUI 7.0.0-dev.2270, Uno.Extensions.Reactive / Navigation 8.0.0-dev.76, Uno.Sdk 7.0.0-dev.73
  • DevServer host 7.0.0-dev.2270; .NET SDK 10.0.400; .NET for Android 36.1.53 (app reports .NET 10.0.8)
  • Android emulator API 36 x86_64, Debug build (UseInterpreter=True, EmbedAssembliesIntoApk=False)

Logs

Android run
mode=body-android host ready; logs X:\skill-ab\repro\hr-repro10-body-android-160012-*
[start net10.0-android] exit=0 46s | Hot Reload: Ready. Edit XAML/C# files and confirm each edit with uno_app_hot_reload_status(file); do NOT restart the app to pick up edits.
    tap before any edit (+1): CountText 0 -> 1 (delta 1) invoke exit=0
[E1 command body +1 -> +10] exit=0 | edit to 'Preflight\Presentation\MainModel.cs': applied (server op #1 Success in 3.2s, local op #2 Success in 1.6s, types: MainModel)
    tap after E1 (+10 if applied): CountText 1 -> 2 (delta 1) invoke exit=0
[E2 command body +10 -> +100] exit=0 | edit to 'Preflight\Presentation\MainModel.cs': applied (server op #2 Success in 0.3s, local op #3 Success in 0.3s, types: MainModel)
    tap after E2 (+100 if applied): CountText 2 -> 3 (delta 1) invoke exit=0
sources reset, host stopped
Desktop run (same steps)
mode=body host ready; logs X:\skill-ab\repro\hr-repro10-body-160255-*
[start net10.0-desktop] exit=0 21s | Hot Reload: Ready. Edit XAML/C# files and confirm each edit with uno_app_hot_reload_status(file); do NOT restart the app to pick up edits.
    tap before any edit (+1): CountText 0 -> 1 (delta 1) invoke exit=0
[E1 command body +1 -> +10] exit=0 | edit to 'Preflight\Presentation\MainModel.cs': applied (server op #1 Success in 2.8s, local op #2 Success in 0.3s, types: MainModel)
    tap after E1 (+10 if applied): CountText 0 -> 10 (delta 10) invoke exit=0
[E2 command body +10 -> +100] exit=0 | edit to 'Preflight\Presentation\MainModel.cs': applied (server op #2 Success in 0.3s, local op #3 Success in 0s, types: MainModel)
    tap after E2 (+100 if applied): CountText 0 -> 100 (delta 100) invoke exit=0
sources reset, host stopped
Android: Hot Reload status JSON and app info around one edit
mode=probe-android host ready; logs X:\skill-ab\repro\hr-repro10-probe-android-155458-*
[start net10.0-android] exit=0 40s | Hot Reload: Ready. Edit XAML/C# files and confirm each edit with uno_app_hot_reload_status(file); do NOT restart the app to pick up edits.
[status json] exit=0
{"content":[{"type":"text","text":"Hot Reload: Ready (server Ready, local Ready) (waited 3.9s)\nedit to \u0027Preflight\\Presentation\\MainModel.cs\u0027: applied (server op #1 Success in 2.5s, local op #2 Success in 1.2s, types: MainModel)\nserver operations (last 1 of 1):\n  #1 Success 2.5s 3s ago MainModel.cs ignored: MainModel.cs.tmp.29020.2a7026a761fe\nlocal operations (last 1 of 1):\n  #2 Success 1.2s 1s ago MainModel"}],"structuredContent":{"state":"Ready","file":"Preflight\\Presentation\\MainModel.cs","verdict":"applied","diagnostics":[]}}
    tap after the edit (+10 if applied): CountText 0 -> 1 (delta 1) invoke exit=0
[diag] exit=0
DevServer Diagnostics
HTTP Port: 58621
Solution: X:\skill-ab\repro\mvux-android\Preflight.sln
Registered Instances: 1
Last Launch: Started
  Target Framework: net10.0-android
  Conveyed Port: 58621
  Timestamp (UTC): 2026-10-13T19:55:29.7103173+00:00
[info] exit=0
Window Title: Preflight
Process Id: 5478
Platform: Android (API level 36) (X64)
.NET Version: .NET 10.0.8
Device Type: Mobile
Operating System: ANDROID
Process Name: yname.preflight
Start Time: 2026-10-13T15:55:23.1336364-04:00
Uptime: 00:00:33.4516470
Hot Reload: Ready
[logcat] 24 lines from pid 5478 -> X:\skill-ab\repro\hr-repro10-probe-android-155458-logcat.txt
sources reset, host stopped
Android: app logcat at the edit
--------- beginning of main
10-13 15:55:51.439 I/yname.preflight( 5478): Explicit concurrent mark compact GC freed 260KB AllocSpace bytes, 0(0B) LOS objects, 49% free, 3185KB/6370KB, paused 855us,1.403ms total 12.794ms
10-13 15:55:51.650 W/monodroid-assembly( 5478): open_from_bundles: failed to load bundled assembly _Microsoft.Android.Resource.Designer.dll
10-13 15:55:51.650 W/monodroid-assembly( 5478): open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
10-13 15:55:51.842 W/monodroid-assembly( 5478): open_from_bundles: failed to load bundled assembly Uno.Core.Extensions.dll
10-13 15:55:51.842 W/monodroid-assembly( 5478): open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
10-13 15:55:52.080 W/monodroid-assembly( 5478): open_from_bundles: failed to load bundled assembly Xamarin.AndroidX.ViewPager.dll
10-13 15:55:52.080 W/monodroid-assembly( 5478): open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
10-13 15:55:52.086 W/monodroid-assembly( 5478): open_from_bundles: failed to load bundled assembly Xamarin.AndroidX.VersionedParcelable.dll
10-13 15:55:52.086 W/monodroid-assembly( 5478): open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
10-13 15:55:52.091 W/monodroid-assembly( 5478): open_from_bundles: failed to load bundled assembly Xamarin.KotlinX.Coroutines.Core.Jvm.dll
10-13 15:55:52.091 W/monodroid-assembly( 5478): open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
10-13 15:55:52.094 W/monodroid-assembly( 5478): open_from_bundles: failed to load bundled assembly Xamarin.Kotlin.StdLib.dll
10-13 15:55:52.094 W/monodroid-assembly( 5478): open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
10-13 15:55:52.098 W/monodroid-assembly( 5478): open_from_bundles: failed to load bundled assembly Xamarin.KotlinX.Serialization.Core.Jvm.dll
10-13 15:55:52.098 W/monodroid-assembly( 5478): open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
10-13 15:55:52.473 W/monodroid-assembly( 5478): open_from_bundles: failed to load bundled assembly Microsoft.Extensions.Diagnostics.Abstractions.dll
10-13 15:55:52.473 W/monodroid-assembly( 5478): open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
10-13 15:55:52.478 W/monodroid-assembly( 5478): open_from_bundles: failed to load bundled assembly System.Xml.XDocument.dll
10-13 15:55:52.478 W/monodroid-assembly( 5478): open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
10-13 15:55:52.479 W/monodroid-assembly( 5478): open_from_bundles: failed to load bundled assembly System.Private.Xml.Linq.dll
10-13 15:55:52.479 W/monodroid-assembly( 5478): open_from_bundles: the assembly might have been uploaded to the device with FastDev instead
10-13 15:55:52.488 I/DOTNET  ( 5478): warn: Uno.Extensions.Navigation.MappedRouteResolver[0]
10-13 15:55:52.488 I/DOTNET  ( 5478):       TypeFromPath - Navigation failed: Could not resolve type for path 'MainModel#1'.

Activity

  1. added
    kind/bug
    triage/untriaged
    area/hot-reload
    platform/android 🤖
    on Oct 14, 2026
  2. added
    7.1
    on Oct 14, 2026
  3. self-assigned this
    on Oct 20, 2026
  4. removed
    7.1
    on Oct 29, 2026
  5. khaskoul commented on Nov 4, 2026

    @khaskoul

    I could not reproduce this on 7.0.0-dev.89 or on 7.0.0-dev.130, so this is a data point rather than a confirmation.

    Setup

    • Uno.Sdk / Uno.Templates 7.0.0-dev.89 (Uno.Extensions 8.0.0-dev.118, Dev Server host 7.0.0-dev.2428), re-run on 7.0.0-dev.130 (Uno.Extensions 8.0.0-dev.155, host 7.0.0-dev.2538) on 2 Nov
    • uno-devserver CLI 7.0.0-dev.2345
    • .NET SDK 10.0.401
    • Android emulator, API 35 (google_apis_playstore, x86_64), Windows 11 host
    • dotnet new unoapp -preset recommended (MVUX) with the Fluent theme, Android head only. The Material theme is not covered by this test (on dev.89 the Material app did not connect to the Dev Server, uno.extensions#3262).
    • A MainModel with one command that calls a private method (return "mvux-before";) and a second command that updates a counter with a lambda (c => c + 1).

    What I did

    1. uno-devserver app start on the emulator, waited for Hot Reload to be Ready, invoked the first command: the page shows the original text. Invoked the counter command once: it adds 1.
    2. Edited the body of the method the first command calls ("mvux-before" to "mvux-after") in MainModel.cs. uno-devserver app hot-reload-status --file MainModel.cs answered applied (server op Success, local op Success, types: MainModel). The next invocation of the command showed mvux-after, 9.8 s after the write.
    3. Edited the lambda (c => c + 1 to c => c + 10). Same applied (... types: MainModel) answer; the next invocation of the counter command added 10.

    Both edits took effect in the running app, without a restart. The result was the same in 3 of 3 runs on dev.89 and in the 7.0.0-dev.130 run of 2 Nov (same timings: 9.8 s to the new text, the counter then adds 10). The check reads the text and the counter from the Android UI dump, independently of the Dev Server, so it is not only the host saying "applied".

    Result of one run (hr18.json of our test):

    {
      "lane": "dev",
      "methodEdit": { "verdictExit": 0, "changed": true, "secondsToEffect": 9.8, "shown": "mvux-after" },
      "lambdaEdit": { "firstClickAdded": 1, "verdictExit": 0, "changed": true, "lastClickAdded": 10 }
    }

    So on this build the scenario from the report works for us. If you still see the old code running, it would help to know the Uno.Sdk and host versions, whether the Material theme is used, and the hot-reload-status answer for the edit. If this was fixed between the reported build and dev.89, the issue may be closable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/hot-reloadkind/bugplatform/android 🤖triage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions