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

iOS: ShellFlyoutRenderer setOverrideUserInterfaceStyle "unrecognized selector sent to instance" exception #17892

Closed
carljohansen opened this issue Oct 8, 2023 · 1 comment · Fixed by #17907
Assignees
Labels
area/shell 🐢 Shell Navigation, Routes, Tabs, Flyout fixed-in-8.0.0-rc.2.9511 Look for this fix in 8.0.0-rc.2.9511 platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending t/bug Something isn't working
Milestone

Comments

@carljohansen
Copy link

carljohansen commented Oct 8, 2023

Description

I created a plain Maui app project from the template and tried to run it on a physical iPhone attached to a Mac Mini (via Pair To Mac). On this line:

    static void Main(string[] args)
    {
        // if you want to use a different Application Delegate class from "AppDelegate"
        // you can specify it here.
        **UIApplication.Main(args, null, typeof(AppDelegate));**
    }

...I got this exception:

Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: -[Microsoft_Maui_Controls_Platform_Compatibility_ShellFlyoutRenderer setOverrideUserInterfaceStyle:]: unrecognized selector sent to instance 0x1016936f0
Native stack trace:
	0   CoreFoundation                      0x00000001f5b97198 <redacted> + 252
	1   libobjc.A.dylib                     0x00000001f4d6f9f8 objc_exception_throw + 56
	2   CoreFoundation                      0x00000001f5ab39bc <redacted> + 0
	3   UIKitCore                           0x000000022259b220 <redacted> + 280
	4   CoreFoundation                      0x00000001f5b9c9c8 <redacted> + 1408
	5   CoreFoundation                      0x00000001f5b9e65c _CF_forwarding_prep_0 + 92
	6   MyFirstMauiForIOS                   0x0000000100bf21d4 xamarin_get_original_working_directory_path + 8920
	7   MyFirstMauiForIOS                   0x0000000100f1dbf4 AppleCryptoNative_X509ImportCollection + 2884288
	8   MyFirstMauiForIOS                   0x0000000100f1c568 AppleCryptoNative_X509ImportCollection + 2878516
	9   MyFirstMauiForIOS                   0x0000000100f10f74 AppleCryptoNative_X509ImportCollection + 2831936
	10  MyFirstMauiForIOS                   0x0000000100f0eb40 AppleCryptoNative_X509ImportCollection + 2822668
	11  MyFirstMauiForIOS                   0x0000000100edd7ec AppleCryptoNative_X509ImportCollection + 2621112
	12  MyFirstMauiForIOS                   0x0000000100e850e8 AppleCryptoNative_X509ImportCollection + 2258868
	13  MyFirstMauiForIOS                   0x0000000100e88d48 AppleCryptoNative_X509ImportCollection + 2274324
	14  MyFirstMauiForIOS                   0x0000000100f4bbf8 AppleCryptoNative_X509ImportCollection + 3072708
	15  MyFirstMauiForIOS                   0x0000000100f82e8c AppleCryptoNative_X509ImportCollection + 3298648
	16  UIKitCore                           0x0000000221fc45ac <redacted> + 112
	17  UIKitCore                           0x0000000221fc46e0 <redacted> + 288
	18  UIKitCore                           0x0000000222a06fc4 <redacted> + 864
	19  QuartzCore                          0x00000001fa0d5c60 <redacted> + 184
	20  QuartzCore                          0x00000001fa0dac08 <redacted> + 332
	21  QuartzCore                          0x00000001fa03d3e4 <redacted> + 348
	22  QuartzCore                          0x00000001fa06b620 <redacted> + 640
	23  UIKitCore                           0x000000022258885c <redacted> + 124
	24  CoreFoundation                      0x00000001f5b28d6c <redacted> + 20
	25  CoreFoundation                      0x00000001f5b28670 <redacted> + 272
	26  CoreFoundation                      0x00000001f5b236d4 <redacted> + 1024
	27  CoreFoundation                      0x00000001f5b22fb4 CFRunLoopRunSpecific + 436
	28  GraphicsServices                    0x00000001f7d2579c GSEventRunModal + 104
	29  UIKitCore                           0x000000022256fc38 UIApplicationMain + 212
	30  MyFirstMauiForIOS                   0x0000000100bc45f4 xamarin_UIApplicationMain + 60
	31  MyFirstMauiForIOS                   0x0000000100f1dc68 AppleCryptoNative_X509ImportCollection + 2884404
	32  MyFirstMauiForIOS                   0x0000000100f1c568 AppleCryptoNative_X509ImportCollection + 2878516
	33  MyFirstMauiForIOS                   0x0000000100f10f74 AppleCryptoNative_X509ImportCollection + 2831936
	34  MyFirstMauiForIOS                   0x0000000100f0eb40 AppleCryptoNative_X509ImportCollection + 2822668
	35  MyFirstMauiForIOS                   0x0000000100edd7ec AppleCryptoNative_X509ImportCollection + 2621112
	36  MyFirstMauiForIOS                   0x0000000100e850e8 AppleCryptoNative_X509ImportCollection + 2258868
	37  MyFirstMauiForIOS                   0x0000000100e8b2c0 AppleCryptoNative_X509ImportCollection + 2283916
	38  MyFirstMauiForIOS                   0x0000000100ee2dc4 AppleCryptoNative_X509ImportCollection + 2643088
	39  MyFirstMauiForIOS                   0x0000000100bf100c xamarin_get_original_working_directory_path + 4368
	40  MyFirstMauiForIOS                   0x0000000100f4b4b8 AppleCryptoNative_X509ImportCollection + 3070852
	41  libdyld.dylib                       0x00000001f55e68e0 <redacted> + 4

Steps to Reproduce

  1. Start Visual Studio 17.8 Preview 2
  2. Create a .NET Maui app using the standard template. Choose .NET 8.
  3. Get a Mac running OS Ventura with the latest XCode
  4. Plug in an iPhone (mine's an iPhone 6 running iOS 12.5)
  5. Pair to the Mac
  6. In VS choose the iPhone as a remote iOS device
  7. Kick off a build-and-debug against the remote device.
  8. You see the splash screen on the phone but then you get the above exception

Link to public reproduction project repository

No response

Version with bug

8.0.0-rc.1.9171

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.92

Affected platforms

iOS

Affected platform versions

iOS 12.5

Did you find any workaround?

no

Relevant log output

Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: -[Microsoft_Maui_Controls_Platform_Compatibility_ShellFlyoutRenderer setOverrideUserInterfaceStyle:]: unrecognized selector sent to instance 0x1016936f0
Native stack trace:
	0   CoreFoundation                      0x00000001f5b97198 <redacted> + 252
	1   libobjc.A.dylib                     0x00000001f4d6f9f8 objc_exception_throw + 56
	2   CoreFoundation                      0x00000001f5ab39bc <redacted> + 0
	3   UIKitCore                           0x000000022259b220 <redacted> + 280
	4   CoreFoundation                      0x00000001f5b9c9c8 <redacted> + 1408
	5   CoreFoundation                      0x00000001f5b9e65c _CF_forwarding_prep_0 + 92
	6   MyFirstMauiForIOS                   0x0000000100bf21d4 xamarin_get_original_working_directory_path + 8920
	7   MyFirstMauiForIOS                   0x0000000100f1dbf4 AppleCryptoNative_X509ImportCollection + 2884288
	8   MyFirstMauiForIOS                   0x0000000100f1c568 AppleCryptoNative_X509ImportCollection + 2878516
	9   MyFirstMauiForIOS                   0x0000000100f10f74 AppleCryptoNative_X509ImportCollection + 2831936
	10  MyFirstMauiForIOS                   0x0000000100f0eb40 AppleCryptoNative_X509ImportCollection + 2822668
	11  MyFirstMauiForIOS                   0x0000000100edd7ec AppleCryptoNative_X509ImportCollection + 2621112
	12  MyFirstMauiForIOS                   0x0000000100e850e8 AppleCryptoNative_X509ImportCollection + 2258868
	13  MyFirstMauiForIOS                   0x0000000100e88d48 AppleCryptoNative_X509ImportCollection + 2274324
	14  MyFirstMauiForIOS                   0x0000000100f4bbf8 AppleCryptoNative_X509ImportCollection + 3072708
	15  MyFirstMauiForIOS                   0x0000000100f82e8c AppleCryptoNative_X509ImportCollection + 3298648
	16  UIKitCore                           0x0000000221fc45ac <redacted> + 112
	17  UIKitCore                           0x0000000221fc46e0 <redacted> + 288
	18  UIKitCore                           0x0000000222a06fc4 <redacted> + 864
	19  QuartzCore                          0x00000001fa0d5c60 <redacted> + 184
	20  QuartzCore                          0x00000001fa0dac08 <redacted> + 332
	21  QuartzCore                          0x00000001fa03d3e4 <redacted> + 348
	22  QuartzCore                          0x00000001fa06b620 <redacted> + 640
	23  UIKitCore                           0x000000022258885c <redacted> + 124
	24  CoreFoundation                      0x00000001f5b28d6c <redacted> + 20
	25  CoreFoundation                      0x00000001f5b28670 <redacted> + 272
	26  CoreFoundation                      0x00000001f5b236d4 <redacted> + 1024
	27  CoreFoundation                      0x00000001f5b22fb4 CFRunLoopRunSpecific + 436
	28  GraphicsServices                    0x00000001f7d2579c GSEventRunModal + 104
	29  UIKitCore                           0x000000022256fc38 UIApplicationMain + 212
	30  MyFirstMauiForIOS                   0x0000000100bc45f4 xamarin_UIApplicationMain + 60
	31  MyFirstMauiForIOS                   0x0000000100f1dc68 AppleCryptoNative_X509ImportCollection + 2884404
	32  MyFirstMauiForIOS                   0x0000000100f1c568 AppleCryptoNative_X509ImportCollection + 2878516
	33  MyFirstMauiForIOS                   0x0000000100f10f74 AppleCryptoNative_X509ImportCollection + 2831936
	34  MyFirstMauiForIOS                   0x0000000100f0eb40 AppleCryptoNative_X509ImportCollection + 2822668
	35  MyFirstMauiForIOS                   0x0000000100edd7ec AppleCryptoNative_X509ImportCollection + 2621112
	36  MyFirstMauiForIOS                   0x0000000100e850e8 AppleCryptoNative_X509ImportCollection + 2258868
	37  MyFirstMauiForIOS                   0x0000000100e8b2c0 AppleCryptoNative_X509ImportCollection + 2283916
	38  MyFirstMauiForIOS                   0x0000000100ee2dc4 AppleCryptoNative_X509ImportCollection + 2643088
	39  MyFirstMauiForIOS                   0x0000000100bf100c xamarin_get_original_working_directory_path + 4368
	40  MyFirstMauiForIOS                   0x0000000100f4b4b8 AppleCryptoNative_X509ImportCollection + 3070852
	41  libdyld.dylib                       0x00000001f55e68e0 <redacted> + 4
@carljohansen carljohansen added the t/bug Something isn't working label Oct 8, 2023
@jsuarezruiz jsuarezruiz added platform/iOS 🍎 area/shell 🐢 Shell Navigation, Routes, Tabs, Flyout labels Oct 9, 2023
@jsuarezruiz jsuarezruiz self-assigned this Oct 9, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Oct 9, 2023
@ghost
Copy link

ghost commented Oct 9, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

mattleibow added a commit that referenced this issue Oct 9, 2023
mattleibow added a commit that referenced this issue Oct 9, 2023
@samhouts samhouts added the potential-regression This issue described a possible regression on a currently supported version., verification pending label Oct 9, 2023
@samhouts samhouts modified the milestones: Backlog, .NET 8 GA Oct 9, 2023
rmarinho added a commit that referenced this issue Oct 10, 2023

### Description of Change

The `overrideUserInterfaceStyle` is only available on iOS 13 and Mac
Catalyst 13.1

<img width="690" alt="image"
src="https://github.com/dotnet/maui/assets/1096616/77d9be78-c39a-49af-bbb6-cf39352a60c5">


### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #17892

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
github-actions bot pushed a commit that referenced this issue Oct 12, 2023
@dotnet dotnet locked as resolved and limited conversation to collaborators Nov 11, 2023
@samhouts samhouts added the fixed-in-8.0.0-rc.2.9511 Look for this fix in 8.0.0-rc.2.9511 label Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/shell 🐢 Shell Navigation, Routes, Tabs, Flyout fixed-in-8.0.0-rc.2.9511 Look for this fix in 8.0.0-rc.2.9511 platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants