Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidOperationException: You must use NaluShell to navigate with INavigationService, in sample project #24

Closed
sumowesley opened this issue Apr 9, 2024 · 6 comments
Labels
bug Issues describing a bug or pull requests fixing a bug.

Comments

@sumowesley
Copy link

Describe the bug

When running the Nalu.Maui.Sample: Before seeing any screens, I get the InvalidOperationException (You must use NaluShell to navigate with INavigationService). The project is unchanged from the download.

I'm keen to explore the library further and would love to see a comparison with the MAUI navigation in the Nalu.Maui.DefaultShellSample.

Steps to reproduce

  1. Download the source from GitHub
  2. Select Nalu.Maui.Sample and debug
  3. See InvalidOperationException in Nalu.Maui.Navigation.dll
nalu_exception

Expected behaviour

I'd expect to see a starting screen so I can see the operation of the navigation.

@sumowesley sumowesley added the bug Issues describing a bug or pull requests fixing a bug. label Apr 9, 2024
@albyrock87
Copy link
Contributor

@sumowesley on which platform are you running the Sample application?

@sumowesley
Copy link
Author

It's on Windows 11, @albyrock87

@albyrock87
Copy link
Contributor

@sumowesley thanks for your bug report.

Nalu.Navigation is mainly focused on mobile platforms (I'm developing from a MacBook so I haven't tested Windows until now).
I had an expectation from Shell... to work kind-of similar on every platform, but apparently Windows is really problematic.

I created a branch https://github.com/nalu-development/nalu/tree/windows-desktop-support to add compatibility with Windows platform, but I see a ton of issues.
It starts, and many navigations are working, but what I see is:

Considering that Nalu.Maui.Navigation does not contain platform-specific code (except a few iOS lines), I must say all of these issues are related to MAUI implementation.
I'm saying that because for example I have no issues at all on Android.

I'm talking to MAUI team in order to see how to solve the situation, but for now, I must say that Windows is not supported due to MAUI bugs.

As soon as I have a workaround I will publish a new version of Nalu and let you know.
Thanks again.

@sumowesley
Copy link
Author

@albyrock87, I'm very grateful for your detailed response and appreciate your focus; our experience of MAUI on Windows is mixed, at best.

I'll track the branch to check for updates, but I fully understand that you're dependent on changes elsewhere. I'm also very grateful for your quick response.

albyrock87 added a commit that referenced this issue Apr 9, 2024
@albyrock87
Copy link
Contributor

@sumowesley I just managed to make it work, see attached PR which will be released in a bit as 3.0.3 on NuGet.

If you just want to try it out, checkout the latest main commit here.

Memory leaks are still there, and the background color on the TitleBar under the menu icon is still not working properly, but that's something outside of my library domain.

You can see the icon is there, but I couldn't set the background color anywhere.
image
Obviously with Nalu you can configure the back icon and the menu icon as you wish, so you can always set a black icon :)

If you want to chat I'm available on Discord with the same username.

@sumowesley
Copy link
Author

Hi @albyrock87, I've pulled the main and have it running. I see what you mean about the memory leaks: moving from one to three and back tells me that ThreePage is still alive, and the same with SixPage if I follow the navigation. I started to add your navigation to one of my projects yesterday. I'll update it to 3.0.3 when available and see if I make more progress (it prompted me to look at your Sample project when I stalled). Many thanks for getting something going so quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug or pull requests fixing a bug.
Projects
None yet
Development

No branches or pull requests

2 participants