PrismLibrary / Prism.Maui

This is an experimental repo. The code here will eventually be merged into the main Prism repo as a full fledged platform at which time this repo will be archived.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App crashes after going to background and coming into foreground again

jahmai-ca opened this issue · comments

This issue is seen in our own app and in the MauiFest 2022 sample at https://github.com/dansiegel/MauiFest2022

Version:

8.1.273-pre

Repro:

  • Launching the MauiFest2022 sample
  • Place app into background
  • Bring app into foreground again

Expected results:

App resumes

Actual results:

App crashes with

System.NotImplementedException: Either set MainPage or override CreateWindow.
   at Microsoft.Maui.Controls.Application.CreateWindow(IActivationState activationState) in D:\a\_work\1\s\src\Controls\src\Core\HandlerImpl\Application\Application.Impl.cs:line 126
   at Microsoft.Maui.Controls.Application.Microsoft.Maui.IApplication.CreateWindow(IActivationState activationState) in D:\a\_work\1\s\src\Controls\src\Core\HandlerImpl\Application\Application.Impl.cs:line 40
   at Microsoft.Maui.Platform.ApplicationExtensions.CreatePlatformWindow(Activity activity, IApplication application, Bundle savedInstanceState) in D:\a\_work\1\s\src\Core\src\Platform\Android\ApplicationExtensions.cs:line 44
   at Microsoft.Maui.MauiAppCompatActivity.OnCreate(Bundle savedInstanceState) in D:\a\_work\1\s\src\Core\src\Platform\Android\MauiAppCompatActivity.cs:line 32
   at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net6.0/android-31/mcw/Android.App.Activity.cs:line 2781
   at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 121

This should be fixed in the net7 version of Prism.Maui

This should be fixed in the net7 version of Prism.Maui

Great! :) Is there an ETA on a nuget release for this?

@dansiegel Sorry to ping you, but it's not clear when net7 support will be available (even as a preview). Any plans for a package release yet?

There is already a net7 preview available to Sponsors on the SponsorConnect feed. As to when that will be made generally available I cannot give an exact date but it is something I am working to make happen.