dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.28k stars 1.76k forks source link

OnNavigatedTo() Object Parameter is NULL after Shell.Current.GoToAsync() call, ONLY happens on Android #14944

Open al185104 opened 1 year ago

al185104 commented 1 year ago

Description

The object Parameter is NULL in OnNavigatedTo() after navigating another page using Shell.Current.GoToAsync(). I was only able to see the issue in Maui-ANDROID. Ran the same code in Maui-Windows, and the issue is not reproducible. Please see the attached video.

Installed Workload Id Manifest Version Installation Source

https://user-images.githubusercontent.com/26172289/236471277-b2227ad2-b3ad-49e2-80c1-cc6826f246b3.mp4


maui-android 7.0.81/7.0.100 VS 17.6.33626.354 android 33.0.46/7.0.100 VS 17.6.33626.354 runtimes-windows 7.0.5/7.0.100 VS 17.6.33626.354 maui-windows 7.0.81/7.0.100 VS 17.6.33626.354 maui-maccatalyst 7.0.81/7.0.100 VS 17.6.33626.354 maui-ios 7.0.81/7.0.100 VS 17.6.33626.354 ios 16.2.2054/7.0.100 VS 17.6.33626.354 maccatalyst 16.2.2054/7.0.100 VS 17.6.33626.354

Steps to Reproduce

  1. Create Login View/Viewmodel - AddSingleton in MauiProgram.
  2. Create Home View/Viewmodel - AddSingleton in MauiProgram.
  3. Install CommunityToolkit.MVVM
  4. Shell.Current.GoToAsync() from LoginViewModel -> HomePage with Dictionary<string, object>.
  5. Run using Android Emulator

Link to public reproduction project repository

https://github.com/al185104/WeeksAhead

Version with bug

6.0.312

Last version that worked well

6.0.312

Affected platforms

Android

Affected platform versions

Android 13

Did you find any workaround?

No response

Relevant log output

No response

ghost commented 1 year ago

Hi @al185104. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

al185104 commented 1 year ago

I actually noticed this after I updated my visual studio. I'm currently using Visual Studio Professional 2022 Preview 17.6.0 Preview 6.0. I'm also using the latest CommunityToolkit.Mvvm version 8.2.0. As far as I know, there's nothing to update. Hope you can help.

al185104 commented 1 year ago

any updates on this sir? or even just a good work around?

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. Repro on Android 13.0-API33 and iOS 16.4, not repro on Windows 11 with below Project: WeeksAhead.zip

Android: image