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.21k stars 1.75k forks source link

Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461 #9360

Closed belmonmi closed 1 year ago

belmonmi commented 2 years ago

Description

Infinite Assertion failure is flooding debug window in Visual Studio 2022 ver. 17.3.0. This is the full message:

2022-08-11 07:52:07.115883-0500 AssertTest[4758:13691038] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461

Only time stamp is changing. I attached a simple project that will reproduce the issue.

AssertTest.zip https://github.com/belmonmi/TestProjectsRepo

Steps to Reproduce

  1. Create a File > New .NET MAUI App
  2. Remove all target but iOS and Android.
  3. Run the application in a simulator, I'm using iPhone 12 Pro iOS 15.5
  4. Make sure that the "XAML Live Preview" window is opened and visible.

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.5

Did you find any workaround?

Close the "XAML Live Preview" window - no more exceptions

Relevant log output

2022-08-11 13:34:35.449190-0500 AssertTest[18389:13849838] 
Options:
2022-08-11 13:34:35.449432-0500 AssertTest[18389:13849838]   --bool-flag (Example)
    type: bool  default: false
2022-08-11 13:34:35.449544-0500 AssertTest[18389:13849838]   --aot-lazy-assembly-load (Load assemblies referenced by AOT images lazily)
    type: bool  default: false
Resolved pending breakpoint for 'AssertTest.Program.Main(System.String[])' to C:\Projects\iNet6\Mobile\Test\AssertTest\AssertTest\Platforms\iOS\Program.cs:10 [0x00000].
Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:419 [0x00000].
Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:414 [0x00000].
2022-08-11 13:34:38.340667-0500 AssertTest[18389:13849838] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=18389
2022-08-11 13:34:38.340967-0500 AssertTest[18389:13849838] SecTaskCopyDebugDescription: AssertTest[18389]/0#-1 LF=0
2022-08-11 13:34:38.347983-0500 AssertTest[18389:13849838] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=18389
2022-08-11 13:34:38.348239-0500 AssertTest[18389:13849838] SecTaskCopyDebugDescription: AssertTest[18389]/0#-1 LF=0
Thread started:  #2
Thread started:  #3
Thread started:  #4
2022-08-11 13:34:39.469375-0500 AssertTest[18389:13849838] [TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <_UIMoreListTableView: 0x7fc3f1411000; frame = (0 0; 0 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x600001dc7960>; layer = <CALayer: 0x6000017ff980>; contentOffset: {0, 0}; contentSize: {0, 0}; adj
ustedContentInset: {0, 0, 0, 0}; dataSource: <UIMoreListController: 0x7fc42086a950>>
2022-08-11 13:34:39.652759-0500 AssertTest[18389:13849838] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=18389
2022-08-11 13:34:39.653046-0500 AssertTest[18389:13849838] SecTaskCopyDebugDescription: AssertTest[18389]/0#-1 LF=0
Thread started: .NET Timers #5
Thread started: <Thread Pool> #6
Thread started: .NET ThreadPool Gate #7
Thread started: <Thread Pool> #8
2022-08-11 13:34:42.931709-0500 AssertTest[18389:13849875] Warning: observer object was not disposed manually with Dispose()
2022-08-11 13:34:42.932014-0500 AssertTest[18389:13849875] Warning: observer object was not disposed manually with Dispose()
Thread started: <Thread Pool> #9
Thread started: <Thread Pool> #10
Thread started: <Thread Pool> #11
Thread started: <Thread Pool> #12
Thread started: <Thread Pool> #13
2022-08-11 13:34:44.646524-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:45.243228-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:45.818684-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:46.425539-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:47.018088-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:47.618175-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:48.223169-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:48.818241-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:49.417697-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:50.018049-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:50.617690-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:51.235229-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:51.824018-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:52.429129-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:53.035817-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:53.617438-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:54.217507-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:54.827833-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:55.419373-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:56.024237-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:56.616001-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:57.216196-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:57.816843-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
2022-08-11 13:34:58.418063-0500 AssertTest[18389:13849838] *** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], UIApplication.m:5461
jfversluis commented 2 years ago

Thanks for the report! Can I maybe ask you to upload the repro to a GitHub repository and link that here? Thanks!

ghost commented 2 years ago

Hi @belmonmi. 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.

belmonmi commented 2 years ago

I created a repository. Is there a special way I have to reference it or I can just include the link? https://github.com/belmonmi/TestProjectsRepo

wickedw commented 2 years ago

I can confirm as of VS for Windows Version 17.4.0 Preview 1.0 this exists for me too.

Hopefully @belmonmi repro above is enough to chase it down.

mattleibow commented 1 year ago

Fixed in https://github.com/dotnet/maui/pull/10855