runtime: Maui Blazor Hybrid app crashes on connected device after splash screen, but works on simulator

Description

Hey all,

Been fighting with this for a while now. My app works fine on mac os, but on ios it only works on the simulator.

The same error occurs whether I send it to test flight or use a connected ios device (connected to a mac on my network)

It crashes after the splash screen displays.

Here is my debug config for ios:

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-ios|AnyCPU'">
	<BuildIpa>false</BuildIpa>
	<CodesignKey>iPhone Developer: Mitch Russell (HV48XX6D9U)</CodesignKey>
	<CodesignProvision>iOS Development AI</CodesignProvision>
	<ApplicationTitle>AlzBetter AI</ApplicationTitle>
	<ApplicationDisplayVersion>1.0.0</ApplicationDisplayVersion>
	<ApplicationVersion>1</ApplicationVersion>
	<MtouchLink>None</MtouchLink>
	<MtouchUseLlvm>True</MtouchUseLlvm>
	<EnableSGenConc>True</EnableSGenConc>
	<UseInterpreter>true</UseInterpreter>
</PropertyGroup>

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

9.0.0-preview.6.24327.7

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

17+

Did you find any workaround?

no

Relevant log output

Here is the VS output window:
`INFO: 
INFO: Creating command connection...
INFO: /Users/mitch/Library/Caches/Xamarin/XMA/SDKs/dotnet/packs/Microsoft.iOS.Sdk.net9.0_17.2/17.2.9714-net9-p6/tools/bin/mlaunch --devname "Mitch’s iPhone" --killdev "/Users/mitch/Library/Caches/Xamarin/mtbs/builds/AbMobileMaui/2664623b18aaf6eba1b99c7c499104288933e927d68fa3e51a7b3eab74c210db/bin/Debug/net9.0-ios/ios-arm64/device-builds/iphone16.2-18.0/AbMobileMaui.app" --launchdev "/Users/mitch/Library/Caches/Xamarin/mtbs/builds/AbMobileMaui/2664623b18aaf6eba1b99c7c499104288933e927d68fa3e51a7b3eab74c210db/bin/Debug/net9.0-ios/ios-arm64/device-builds/iphone16.2-18.0/AbMobileMaui.app" -argument=-monodevelop-port -argument=10000 -argument=-connection-mode -argument=usb --setenv=__XAMARIN_DEBUG_PORT__=10000 --wait-for-unlock   -v --sdkroot "/Applications/Xcode.app/Contents/Developer" -sdk 18.0
INFO: [iOS Debugger] Connecting to "Mitch’s iPhone" over USB on port 10000...
INFO: Launching...
INFO: Starting debugger connection to the app 'AbMobileMaui'. Debugger port: 56501, Device port: 10000
INFO: Launching app 'AbMobileMaui' on device...
INFO: Xamarin.Hosting: Device discovery started
INFO: Using Xcode 15.4 found in /Applications/Xcode.app/Contents/Developer
INFO: Xamarin.Hosting: Connected to Mitch’s iPhone (00008130-000618A61003401C) in 00:00:00.0025563
INFO: Xamarin.Hosting: Device discovery event: GizmoPaired (00008301-A88EF1AA1180202E)
INFO: Xamarin.Hosting: Device discovery event: Connected (00008301-A88EF1AA1180202E)
INFO: Xamarin.Hosting: Device discovery event: Connected (00008130-000618A61003401C)
INFO: Xamarin.Hosting:     Xcode: /Applications/Xcode.app
INFO: Xamarin.Hosting:     Version: 7dbab91212 (refs/heads/main)
INFO: Xamarin.Hosting: Connected to Mitch’s Apple Watch Ultra (00008301-A88EF1AA1180202E) in 00:00:00.0031393
INFO: Xamarin.Hosting:     Xcode Version: 15.4
INFO: Xamarin.Hosting:     Verbosity: 1
INFO: Xamarin.Hosting: Xamarin.Hosting
INFO: xcrun devicectl -j /var/folders/d1/43d729sj4x56j9zw2b13bp7r0000gn/T/tmp8lB6CI.tmp -v device info lockState --device "Mitch’s iPhone"
INFO: 	? unlockedSinceBoot: true
INFO: 	? passcodeRequired: false
INFO: 	Saving JSON output file to /var/folders/d1/43d729sj4x56j9zw2b13bp7r0000gn/T/tmp8lB6CI.tmp
INFO: 	Command Completed, took 1.198 seconds
INFO: 	Using verbose logging.
INFO: 	? deviceIdentifier: 13AE7EF8-6B67-4A3E-966B-E232116C293C
INFO: 	Current device lock state:
INFO: xcrun devicectl -j /var/folders/d1/43d729sj4x56j9zw2b13bp7r0000gn/T/tmp2DYZiy.tmp -v device process launch --terminate-existing --device "Mitch’s iPhone" com.alzbetterai.app --monodevelop-port 10000 --connection-mode usb
INFO: 	Command Completed, took 1.319 seconds
INFO: The app 'com.alzbetterai.app' launched with pid 13367
INFO: 	Saving JSON output file to /var/folders/d1/43d729sj4x56j9zw2b13bp7r0000gn/T/tmp2DYZiy.tmp
INFO: 	Launched application with com.alzbetterai.app bundle identifier.
INFO: 	2024-07-20 18:51:57.867-0400  Acquired usage assertion.
INFO: 	2024-07-20 18:51:57.821-0400  Enabling developer disk image services.
INFO: 	Using verbose logging.
INFO: The application has been launched
INFO: 
INFO: [iOS Debugger] Connected to "Mitch’s iPhone" over USB on port 10000.
INFO: Debugger connection signal received
INFO: 	0x1a08c8ad8 - /usr/lib/system/libsystem_c.dylib : abort

INFO: 	0x100db29f0 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : monoeg_g_logv

INFO: 	0x100db2b38 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : monoeg_g_log

INFO: 	0x1be938734 - /usr/lib/dyld : <redacted>

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x1e8c41254):0x1e8c41244  ff 0f 5f d6 c0 03 5f d6 10 29 80 d2 01 10 00 d4  .._..._..).....
INFO: 	0x100ed7b6c - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mono_jit_init_version

INFO: 	0x100cf58ec - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : xamarin_main

INFO: Debugger connection completed
INFO: Waiting for the debugger connection signal...
INFO: [iOS Debugger] Connected to "Mitch’s iPhone" over USB on port 10000.
INFO: [iOS Debugger] Connecting to "Mitch’s iPhone" over USB on port 10000...
INFO: [iOS Debugger] Connecting to "Mitch’s iPhone" over USB on port 10000...
INFO: [iOS Debugger] Connected to "Mitch’s iPhone" over USB on port 10000.
INFO: Connecting to debug stream from device...
INFO: Connecting to debug console stream...
INFO: Connecting to remote debugger on port 56501...
INFO: Connecting to debug stream from remote debugger...
INFO: 
=================================================================
	Native Crash Reporting
=================================================================
Got a SIGABRT while executing native code. This usually indicates

INFO: a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
	Native stacktrace:
=================================================================

INFO: 	0x100cf078c - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : xamarin_bridge_initialize

INFO: .
0x1e8c41254  03 01 00 54 7f 23 03 d5 fd 7b bf a9 fd 03 00 91 
INFO: 	0x100ed03c0 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mini_init

INFO: 	0x100e151e4 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mono_assembly_open

INFO:  ...T.#...{......
0x1e8c41264  31 ec ff 97 bf 03 00 91 fd 7b c1 a8 ff 0f 5f d6  1........{...._.
0x1e8c41274  c0 03 5f d6 10 27 80 d2 01 10 00 d4 03 01 00 54  
INFO: 	0x100cf5034 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : xamarin_assembly_preload_hook

INFO: 	0x100e13540 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mono_assembly_request_open

INFO: 	0x100e13a24 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mono_assembly_request_load_from

INFO: 	0x100dbd2c4 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mono_log_write_os_log

INFO: 	0x100eda38c - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : load_aot_module

INFO: 	0x21fd43ef8 - /usr/lib/system/libsystem_pthread.dylib : pthread_kill

INFO: 	0x100f022e4 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mono_runtime_setup_stat_profiler
	0x21fc8fafc - /usr/lib/system/libsystem_platform.dylib : <redacted>

INFO: 	0x10105545c - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : sigabrt_signal_handler.cold.1

INFO: 	0x100eed32c - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mono_handle_native_crash

INFO: 	0x100f029f4 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mono_dump_native_crash_info

INFO: 	0x100e15678 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mono_assembly_load_corlib
	0x100e10cbc - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : mono_init

INFO: 	0x100e15490 - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : invoke_assembly_preload_hook

INFO: .._..'.........T

The app has been terminated.
INFO: Closing debug connection from device (USB)
INFO: 	0x100f4542c - /private/var/containers/Bundle/Application/7EC5EFB6-C63D-4502-A196-4B7255011A81/AbMobileMaui.app/AbMobileMaui : main

INFO: Disposing input and output streams...
INFO: Disposing input and output streams...
INFO: Disposing console and debugger streams...
ERROR: An error occurred while writing to the debug stream. Details: ObjectDisposed_Generic
ObjectDisposed_ObjectName_Name, UsbStream
ERROR: An error occurred when writing to the output stream. Details: net_io_readfailure, Operation canceled
INFO: Closing debug connection from remote debugger (TCP)
`

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23 (10 by maintainers)

Most upvoted comments

Preview 7 fixed this, thank you!