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

[regression/8.0.0-rc.2.9511] [iOS] Can't debug or deploy to a physical device #18528

Closed
Dokug opened this issue Nov 5, 2023 · 14 comments
Closed
Labels
area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging partner/macios Issues for the Mac / iOS SDK platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working

Comments

@Dokug
Copy link

Dokug commented Nov 5, 2023

Description

With the latest MAUI RC I have noticed that when trying to debug (or even deploying) to a physical device, the app crashes after the launch screen.
According to the debug log and break points, the app is executing my startup logic but always crashes (with no exception or message) after these 2 lines in VS Code's debug console:

Loaded assembly: /private/var/containers/Bundle/Application/8AEFB3AE-6CA1-4FB1-93D3-B551655543A2/MyApp.app/mscorlib.dll
Loaded assembly: /private/var/containers/Bundle/Application/8AEFB3AE-6CA1-4FB1-93D3-B551655543A2/MyApp.app/System.dll

It may be worth mentioning that I get the following build warnings:

ILLINK : warning MT4189: The class 'PassKit.PKDisbursementAuthorizationController' will not be registered it has been removed from the iOS SDK. [/Users/MyName/Programming/MyApp/Renderer/Renderer.csproj::TargetFramework=net8.0-ios]
ILLINK : warning MT4189: The class 'PassKit.PKDisbursementAuthorizationControllerDelegate' will not be registered it has been removed from the iOS SDK. [/Users/mathias/Programming/MyApp/Renderer/Renderer.csproj::TargetFramework=net8.0-ios]
ILLINK : warning MT4178: The class 'NewsstandKit.NKAssetDownload' will not be registered because the NewsstandKit framework has been removed from the iOS SDK. [/Users/MyName/Programming/MyApp/Renderer/Renderer.csproj::TargetFramework=net8.0-ios]
ILLINK : warning MT4178: The class 'NewsstandKit.NKLibrary' will not be registered because the NewsstandKit framework has been removed from the iOS SDK. [/Users/MyName/Programming/MyApp/Renderer/Renderer.csproj::TargetFramework=net8.0-ios]
ILLINK : warning MT4178: The class 'NewsstandKit.NKIssue' will not be registered because the NewsstandKit framework has been removed from the iOS SDK. [/Users/MyName/Programming/MyApp/Renderer/Renderer.csproj::TargetFramework=net8.0-ios]

I don't use these kits and have also checked with the method described in dotnet/macios#18964 that my app should not be affected by this.

Steps to Reproduce

Debug or deploy a MAUI project on a physical device.

Link to public reproduction project repository

No response

Version with bug

8.0.0-rc.2.9511

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.96

Affected platforms

iOS

Affected platform versions

iOS 17

Did you find any workaround?

Not yet.

Relevant log output

[...]
Thread started:  #11
Thread started:  #12
[0:] My yustom debug message (shows that my code is executed).
Loaded assembly: /private/var/containers/Bundle/Application/40512BCC-493D-4955-B408-EA36E749EAA3/MyApp.app/mscorlib.dll
Loaded assembly: /private/var/containers/Bundle/Application/40512BCC-493D-4955-B408-EA36E749EAA3/MyApp.app/System.dll
Stopping iOS process...
iOS Process was stopped.
@Dokug Dokug added the t/bug Something isn't working label Nov 5, 2023
@Dokug
Copy link
Author

Dokug commented Nov 6, 2023

After digging through the device logs on my physical device, I found this:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: D48EA0A5-7F50-4B9C-9562-E3F390459CEF
CrashReporter Key:   156bc4f66d540ec32fa8516c2540441af69ece5e
Hardware Model:      iPad13,2
Process:             MyApp [2599]
Path:                /private/var/containers/Bundle/Application/642F85C6-B198-4362-AE15-0F6BF5438C89/MyApp.app/MyApp
Identifier:          com.company.myapp
Version:             1.0.4 (38)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.company.myapp [1262]

Date/Time:           2023-11-05 23:14:54.8920 +0100
Launch Time:         2023-11-05 23:14:33.9339 +0100
OS Version:          iPhone OS 17.0.3 (21A360)
Release Type:        User
Baseband Version:    5.00.00
Report Version:      104

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: FRONTBOARD 2343432205 
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-create watchdog transgression: app<com.company.myapp(D5C1086A-A3E1-4FB6-B19D-6ECF285C06BC)>:2599 exhausted real (wall clock) time allowance of 17.38 seconds
ProcessVisibility: Foreground
ProcessState: Running
WatchdogEvent: scene-create
WatchdogVisibility: Foreground
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 20.300 (user 15.840, system 4.460), 19% CPU",
"Elapsed application CPU time (seconds): 11.035, 10% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>

Triggered by Thread:  0

Kernel Triage:
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter


Thread 0 name:  tid_103 Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	       0x1f61b4b7c __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x21875dfd4 _pthread_cond_wait + 1227
2   MyApp                	                       0x1008295b4 0x100654000 + 1922484
3   MyApp                	                       0x10082bc4c 0x100654000 + 1932364
4   MyApp                	                       0x10082b3c8 0x100654000 + 1930184
5   MyApp                	                       0x1008400b8 0x100654000 + 2015416
6   MyApp                	                       0x100836920 0x100654000 + 1976608
7   MyApp                	                       0x1006649e4 0x100654000 + 68068
8   MyApp                	                       0x1009d0224 0x100654000 + 3654180
9   MyApp                	                       0x1009ce3ac 0x100654000 + 3646380
10  MyApp                	                       0x1009c359c 0x100654000 + 3601820
11  MyApp                	                       0x100992228 0x100654000 + 3400232
12  MyApp                	                       0x100939b18 0x100654000 + 3037976
13  MyApp                	                       0x10093d778 0x100654000 + 3053432
14  MyApp                	                       0x100a04758 0x100654000 + 3868504
15  MyApp                	                       0x100a07958 0x100654000 + 3881304
16  UIKitCore                     	       0x1b17fa174 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1715
17  UIKitCore                     	       0x1b17f9d6c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 683
18  UIKitCore                     	       0x1b17f9d6c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 683
19  UIKitCore                     	       0x1b17f9d6c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 683
20  UIKitCore                     	       0x1b17f9d6c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 683
21  UIKitCore                     	       0x1b17f97f8 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 123
22  UIKitCore                     	       0x1b17f970c -[UIView _postMovedFromSuperview:] + 483
23  UIKitCore                     	       0x1b17f8350 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2179
24  UIKitCore                     	       0x1b19015cc -[UINavigationTransitionView transition:fromView:toView:] + 455
25  UIKitCore                     	       0x1b1901354 -[UINavigationController _startTransition:fromViewController:toViewController:] + 2347
26  UIKitCore                     	       0x1b19005a4 -[UINavigationController _startDeferredTransitionIfNeeded:] + 607
27  UIKitCore                     	       0x1b18ffc2c -[UINavigationController __viewWillLayoutSubviews] + 95
28  UIKitCore                     	       0x1b18ffb90 -[UILayoutContainerView layoutSubviews] + 171
29  UIKitCore                     	       0x1b181b184 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1527
30  QuartzCore                    	       0x1b0c33888 CA::Layer::layout_if_needed(CA::Transaction*) + 499
31  QuartzCore                    	       0x1b0c33410 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 143
32  QuartzCore                    	       0x1b0c3994c CA::Context::commit_transaction(CA::Transaction*, double, double*) + 463
33  QuartzCore                    	       0x1b0c32c3c CA::Transaction::commit() + 647
34  UIKitCore                     	       0x1b1b05dc8 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 35
35  CoreFoundation                	       0x1af60cb58 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 27
36  CoreFoundation                	       0x1af60b34c __CFRunLoopDoBlocks + 355
37  CoreFoundation                	       0x1af60924c __CFRunLoopRun + 847
38  CoreFoundation                	       0x1af608e18 CFRunLoopRunSpecific + 607
39  GraphicsServices              	       0x1f20cd5ec GSEventRunModal + 163
40  UIKitCore                     	       0x1b1a172fc -[UIApplication _run] + 887
41  UIKitCore                     	       0x1b1a16938 UIApplicationMain + 339
42  MyApp                	                       0x1006805f4 xamarin_UIApplicationMain + 60
43  MyApp                	                       0x1009d26c4 0x100654000 + 3663556
44  MyApp                	                       0x1009d0fc4 0x100654000 + 3657668
45  MyApp                	                       0x1009c59d0 0x100654000 + 3611088
46  MyApp                	                       0x1009c359c 0x100654000 + 3601820
47  MyApp                	                       0x100992228 0x100654000 + 3400232
48  MyApp                	                       0x100939b18 0x100654000 + 3037976
49  MyApp                	                       0x10093fcf0 0x100654000 + 3063024
50  MyApp                	                       0x100997820 0x100654000 + 3422240
51  MyApp                	                       0x1006acfb8 0x100654000 + 364472
52  MyApp                	                       0x1009fff5c 0x100654000 + 3850076
53  dyld                          	               0x1d1df3d44 start + 2103

@drasticactions
Copy link
Contributor

If you deploy a .NET iOS app that doesn't use MAUI (Ex dotnet new ios) does the same error occur?

@drasticactions drasticactions added the s/needs-info Issue needs more info from the author label Nov 6, 2023
@ghost
Copy link

ghost commented Nov 6, 2023

Hi @Dokug. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. 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.

@Dokug
Copy link
Author

Dokug commented Nov 6, 2023

No, the standard app template for dotnet new ios works without a problem and displays "Hello, iOS!"

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Nov 6, 2023
@Dokug
Copy link
Author

Dokug commented Nov 6, 2023

After some more tinkering I identified this block in one of the main page's constructor as the culprit:

Border frame = new()
                {
                    BackgroundColor = Colors.Gray,
                    Stroke = Colors.Gray,
                    Margin = -0.5
                };

frame.SetBinding(
                    IsVisibleProperty,
                    $"{nameof(CduViewModel.Screen)}[{row}].{nameof(CduText.Inverted)}[{col}]");


                ScreenGrid.Add(frame, col, row);

Changing the frame to a BoxView solved the startup crash on iOS

@Eilon Eilon added the area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging label Nov 6, 2023
@riccardominato
Copy link

riccardominato commented Nov 24, 2023

ILLINK : warning MT4189: The class 'PassKit.PKDisbursementAuthorizationController' will not be registered it has been removed from the iOS SDK. [/Users/MyName/Programming/MyApp/Renderer/Renderer.csproj::TargetFramework=net8.0-ios]
ILLINK : warning MT4189: The class 'PassKit.PKDisbursementAuthorizationControllerDelegate' will not be registered it has been removed from the iOS SDK. [/Users/mathias/Programming/MyApp/Renderer/Renderer.csproj::TargetFramework=net8.0-ios]
ILLINK : warning MT4178: The class 'NewsstandKit.NKAssetDownload' will not be registered because the NewsstandKit framework has been removed from the iOS SDK. [/Users/MyName/Programming/MyApp/Renderer/Renderer.csproj::TargetFramework=net8.0-ios]
ILLINK : warning MT4178: The class 'NewsstandKit.NKLibrary' will not be registered because the NewsstandKit framework has been removed from the iOS SDK. [/Users/MyName/Programming/MyApp/Renderer/Renderer.csproj::TargetFramework=net8.0-ios]
ILLINK : warning MT4178: The class 'NewsstandKit.NKIssue' will not be registered because the NewsstandKit framework has been removed from the iOS SDK. [/Users/MyName/Programming/MyApp/Renderer/Renderer.csproj::TargetFramework=net8.0-ios]

These warnings are still there in .NET8 GA.

You can try creating two fresh applications using dotnet new ios and dotnet new maui and building them with the same exact command dotnet build -f net8.0-ios -p:RuntimeIdentifier=ios-arm64.
The first doesn't show any warning, while the second does.

This looks weird to me: shouldn't MAUI use .NET iOS under the hood? Could it be linked to an older version of .NET iOS?

@samhouts samhouts added potential-regression This issue described a possible regression on a currently supported version., verification pending partner/macios Issues for the Mac / iOS SDK labels Dec 6, 2023
@samhouts
Copy link
Member

samhouts commented Dec 7, 2023

@rolfbjarne Does this look familiar to you?

@samhouts samhouts changed the title [iOS] Can't debug or deploy to a physical device [regression/8.0.0-rc.2.9511] [iOS] Can't debug or deploy to a physical device Dec 7, 2023
@rolfbjarne
Copy link
Member

Termination Reason: FRONTBOARD 2343432205

2343432205 = 0x8BADF00D, which means the iOS launch watchdog terminated the app because it took too long to launch.

Ref: https://developer.apple.com/documentation/xcode/addressing-watchdog-terminations

The crash report also says:

explanation:scene-create watchdog transgression: app [...] exhausted real (wall clock) time allowance of 17.38 seconds

@mattleibow
Copy link
Member

What device is this? I find a debug build does not launch on my old iPhones. Try launching a releae build and see. I do know the interpreter takes a long time to start up in debug - and potentially the hot reload.

@mattleibow mattleibow added s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels Dec 11, 2023
@ghost
Copy link

ghost commented Dec 11, 2023

Hi @Dokug. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. 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.

@Dokug
Copy link
Author

Dokug commented Dec 11, 2023

That was an iPad Air 4th generation and a normal iPad 12th generation device

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Dec 11, 2023
@joselgarza
Copy link

Have these warnings been fixed?

@riccardominato
Copy link

Nope, but they should be harmless. #19012

@kevinxufei
Copy link

This issue was verified using Visual Studio 17.6.10 build428 (maui:8.0.7). Can be deployed to iOS devices (iOS version: 16.2&17.2.1), hot reloading is normal, but the warning still exists.

@kevinxufei kevinxufei added the s/triaged Issue has been reviewed label Mar 11, 2024
@kevinxufei kevinxufei added the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Mar 11, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging partner/macios Issues for the Mac / iOS SDK platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants