unoplatform / uno.extensions

Libraries to ease common developer tasks associated with building multi-platform mobile, desktop and web applications using Uno Platform or WinAppSDK.
https://platform.uno/
Other
72 stars 46 forks source link

[Navigation] App is not launched if Navigation is used without Toolkit #2419

Closed agneszitte closed 2 months ago

agneszitte commented 2 months ago

Current behavior

When creating a new Uno project with certain custom options detailed below, the application does not launch correctly or displays a blank screen on some platforms.

Summary of the options

image

Written summary of the options (click here to expand) **Framework** - .NET 8.0 **Platforms** - Android, iOS, WebAssembly, macOS (Catalyst), Windows, Desktop **Presentation** - MVVM **Markup** - XAML **Theme** - Material, Theme Service, Import Uno DSP **Extensions** - Dependency Injection, Configuration, Localization, Regions, Default **Features** - WASM Multi-Threading, PWA Manifest, Visual Studio Code Debugging **Authentication** - None **CI Pipeline** - None

Related dotnet new command to create a project with these options

dotnet new unoapp -o UnoTestNavIssue -preset "recommended" -theme-service -wasm-multi-threading -theme "material" -presentation "mvvm" -config -di -log "default" -nav "regions" -http False -loc -tests "none" -toolkit False -dsp -id "com.companyname.UnoTestNavIssue" -pub "O=UnoPlatform"

Expected behavior

The application should launch and function correctly on all specified platforms with the given custom options.

How to reproduce it (as minimally and precisely as possible)

  1. Create a new Uno project using the custom options mentioned in the issue.
  2. Launch the application on all platforms.
  3. Observe that on some platforms, the application does not launch correctly or displays a blank screen on some platforms.

Workaround

Create a new sample solution: Select the Toolkit option in addition to the other options you chose previously.

Update your existing solution: Follow the steps mentioned here:

Works on UWP/WinUI

Yes

Relevant plugins

N/A

Anything else we need to know?


Tested with Uno.Sdk 5.2 Stable


Tested with (Upcoming) Uno.Sdk 5.3 Stable

jeromelaban commented 2 months ago

There's no exception happening, no logging that can indicate what's not working, but there's this in the logs:

warn: Uno.Extensions.Storage.FileStorage[0]
      ReadPackageFileAsync - File 'appsettings.keyvaluestorageconfiguration.json' does not exist in package
warn: Uno.Extensions.Storage.FileStorage[0]
      ReadPackageFileAsync - File 'appsettings.appconfig.json' does not exist in package
warn: Uno.Extensions.Storage.FileStorage[0]
      ReadPackageFileAsync - File 'appsettings.localizationconfiguration.json' does not exist in package
warn: Uno.Extensions.Storage.FileStorage[0]
      ReadPackageFileAsync - File 'appsettings.localizationsettings.json' does not exist in package
warn: Uno.Extensions.Storage.FileStorage[0]
      ReadPackageFileAsync - File 'appsettings.navigationconfiguration.json' does not exist in package
warn: Uno.Extensions.Navigation.Navigators.ContentControlNavigator[0]
      Show - Missing view for navigation path ''
jeromelaban commented 2 months ago

@agneszitte for WSL 2, this is happening because you have not configured WSLg.

agneszitte commented 2 months ago

@agneszitte for WSL 2, this is happening because you have not configured WSLg.

@jeromelaban you are right, I am apparently missing a little bit of setup for Desktop WSL2 on my other machine where I tested the sample for 5.2 stable. I just re-did another test on my other machine that is properly setup and I have an empty window. I have updated the description of the issue for the test with 5.2 for WSL. When testing Desktop WS2 with 5.3 stable I don't have any issues anymore.

eriklimakc commented 2 months ago

That's an issue with Navigation. If Toolkit is added and UseToolkitNavigation() is initialized on App.xaml.cs as in

 var builder = this.CreateBuilder(args)
+     .UseToolkitNavigation()
     .Configure(host => host
....

The app will launch and work. Needs further investigation.

jeromelaban commented 2 months ago

@dansiegel @nickrandolph This would be a templates issue where the call to UseToolkitNavigation should be included.

dansiegel commented 2 months ago

This is not a template issue. If we create a project as @agneszitte showed then there is no Toolkit references in the project. From a Template perspective this is correct. This issue is that Navigation without Toolkit appears to be broken.

metacoresystems commented 2 months ago

I second the comment above. It is not a template issue, not even an extensions issue - the issue is that non-toolkit navigation is fundamentally broken.