Closed JORGEGO closed 1 month ago
I am replacing all the embedded resources images for MauiImages and seems works must better
Hi @JORGEGO. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
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.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
My latest experience is that if I don't use the embedded resources, the black/white screens don't appear... It seems that if a page uses a list of embedded resources, instead of using MAUI images, it ends up on Android a memory freeing problem, so after changing the resources to MAUIImages, the screens don't seem to appear anymore... I'll keep you posted
We might be seeing the same thing here. I'll try and get some more info shortly.
Once we put the app in the background and then back in the foreground, it's fine for a time but it does happen somewhat randomly. It happens 100% of the time when the app is first started, as seen in the above recording.
@kfrancis i think this is fixed in .net8 preview according to #14109 - could you give it a shot?
@kfrancis Not repro on android platform with Visual Studio Enterprise 17.8.0 Preview 1.0(.NET8) using this sample project (https://github.com/dotnet/maui-samples/tree/main/7.0/Navigation/ShellFlyoutSample), could you have a try on .NET8 to see if it works fine? Thanks.
@jinxinjuan Reproduced and filed it here (as it looks possibly related to toolkit, but based on the stack trace it might not be): https://github.com/CommunityToolkit/Maui/issues/1368
Stack trace:
Android.Util.AndroidRuntimeException
Message=Only the original thread that created a view hierarchy can touch its views.
0xFFFFFFFFFFFFFFFF in Android.Runtime.JNIEnv.monodroid_debugger_unhandled_exception C#
0x1A in Android.Runtime.JNINativeWrapper._unhandled_exception at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:12,5 C#
0x1D in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:23,26 C#
0x17 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw C#
0x89 in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:12324,5 C#
0x78 in Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:75,7 C#
0x12 in Android.Views.View.RequestLayout at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net7.0/android-33/mcw/Android.Views.View.cs:20879,5 C#
0x8 in Microsoft.Maui.Platform.WrapperView.RequestLayout at D:\a\_work\1\s\src\Core\src\Platform\Android\WrapperView.cs:89,4 C#
0x8 in Android.Views.View.n_RequestLayout at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net7.0/android-33/mcw/Android.Views.View.cs:20869,4 C#
0x8 in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:22,5 C#
0x37 in Java.Interop.NativeMethods.java_interop_jnienv_call_static_void_method_a C#
0x54 in Java.Interop.JniEnvironment.StaticMethods.CallStaticVoidMethod at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:13246,4 C#
0x1A in Java.Interop.JniPeerMembers.JniStaticMethods.InvokeVoidMethod at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniStaticMethods.cs:97,4 C#
0x7B in Microsoft.Maui.PlatformInterop.LoadImageFromStream at D:\a\_work\1\s\src\Core\src\obj\Release\net7.0-android\generated\src\Microsoft.Maui.PlatformInterop.cs:443,5 C#
0xC8 in Microsoft.Maui.StreamImageSourceService.LoadDrawableAsync at D:\a\_work\1\s\src\Core\src\ImageSources\StreamImageSourceService\StreamImageSourceService.Android.cs:28,6 C#
0x11 in System.Runtime.CompilerServices.AsyncTaskMethodBuilder<Microsoft.Maui.IImageSourceServiceResult>.AsyncStateMachineBox<Microsoft.Maui.StreamImageSourceService.<LoadDrawableAsync>d__0>.ExecutionContextCallback C#
0x17 in System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop C#
0x55 in System.Runtime.CompilerServices.AsyncTaskMethodBuilder<Microsoft.Maui.IImageSourceServiceResult>.AsyncStateMachineBox<Microsoft.Maui.StreamImageSourceService.<LoadDrawableAsync>d__0>.MoveNext C#
0x2 in System.Runtime.CompilerServices.AsyncTaskMethodBuilder<Microsoft.Maui.IImageSourceServiceResult>.AsyncStateMachineBox<Microsoft.Maui.StreamImageSourceService.<LoadDrawableAsync>d__0>.ExecuteFromThreadPool C#
0xC in System.Threading.ThreadPoolWorkQueue.DispatchWorkItem C#
0x142 in System.Threading.ThreadPoolWorkQueue.Dispatch C#
0x67 in System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart C#
0x1F in System.Threading.Thread.StartHelper.RunWorker C#
0x28 in System.Threading.Thread.StartHelper.Run C#
0xF in System.Threading.Thread.StartCallback C#
What the absolute minimal repro looks like:
@jinxinjuan While it doesn't exactly repo the same in net 8.0.0-preview.7.8842 - the control is still not rendering (though the exception and the white screen issue are now gone):
This issue has been verified using Visual Studio 17.12 Preview 1 (8.0.80 & 8.0.72). Not repro on android platform. Using this sample project: https://github.com/dotnet/maui-samples
Hi @JORGEGO. 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.
Description
We are migrating our apps from Xamarin to MAUI. Our apps use Shell and use routes all works as expected in windows and in Android... but behavior's in android when you navigate during some time start to show white or black windows (depend of your theme android). I debug my app trying to understand what happen and I believe it is related to the memory:
In my case, for example: AnswerMailboxPage works perfectly any page works perfectly, but if you navigate may times for different page any page not render, navigate perfect: await Shell.Current.GoToAsync($"Todo.MailBox.AnswerMailboxPage?pIdMailbox={lMailboxItem.IdMessage}"); but not render the page and the debug output show this information in the case that show white or black screen
Steps to Reproduce
If you create any project with shell and navigate passing parameters to the page for about 30 times for different pages start this behaviour...
Link to public reproduction project repository
I can not share the code
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 for the moment, I have also added to the android manifest android:enableOnBackInvokedCallback="true" but nothing
Relevant log output