godotengine / godotengine/godot
BUG IN CLIENT OF UIKIT: An exception was thrown (and suppressed) while evaluating supported interface orientations.
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in:
- Godot 4.2.1.stable
- IPad Air 2
- iOS 15.8.1
### System information
Godot 4.2.1 iOS 15.8.1 Vulkan API 1.2.275 - Forward Mobile - Using Vulkan Device #0: Apple - Apple A8X GPU
### Issue description
Godot native application crashes with the following error on iOS 15 device even if the [official documentation](https://docs.godotengine.org/en/stable/about/system_requirements.html#id2) stated that iOS 11+ are supported
---
2024-03-02 18:59:48.838658-0600 AppName[749:20200] Metal GPU Frame Capture Enabled
2024-03-02 18:59:48.841388-0600 AppName[749:20200] Metal API Validation Enabled
2024-03-02 18:59:48.961862-0600 AppName[749:20200] Vulkan API 1.2.275 - Forward Mobile - Using Vulkan Device #0: Apple - Apple A8X GPU
Vulkan API 1.2.275 - Forward Mobile - Using Vulkan Device #0: Apple - Apple A8X GPU
2024-03-02 18:59:49.011643-0600 AppName[749:20200] [General] **BUG IN CLIENT OF UIKIT: An exception was thrown (and suppressed) while evaluating supported interface orientations. UIViewController.supportedInterfaceOrientations should always return a UIInterfaceOrientationMask. Suppressed exception: "Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES"**
2024-03-02 18:59:49.011941-0600 AppName[749:20200] USER ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
2024-03-02 18:59:49.012022-0600 AppName[749:20200] at: _window_create (drivers/vulkan/vulkan_context.cpp:1837)
USER ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
at: _window_create (drivers/vulkan/vulkan_context.cpp:1837)
2024-03-02 18:59:49.012430-0600 AppName[749:20200] USER ERROR: Failed to create Vulkan window.
2024-03-02 18:59:49.012539-0600 AppName[749:20200] at: DisplayServerIOS (platform/ios/display_server_ios.mm:88)
USER ERROR: Failed to create Vulkan window.
at: DisplayServerIOS (platform/ios/display_server_ios.mm:88)
2024-03-02 18:59:49.012632-0600 AppName[749:20200] USER ERROR: Unable to create DisplayServer, all display drivers failed.
2024-03-02 18:59:49.012737-0600 AppName[749:20200] at: setup2 (main/main.cpp:2394)
USER ERROR: Unable to create DisplayServer, all display drivers failed.
at: setup2 (main/main.cpp:2394)
2024-03-02 18:59:49.032053-0600 AppName[749:20200] *** **Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES'**
*** First throw call stack:
(0x181ab0c60 0x1992e0ee4 0x181b03e64 0x183f94d1c 0x183f54c6c 0x1842d1d60 0x183f1d9f8 0x183ff8034 0x183f2493c 0x1995a6bac 0x183fb0688 0x183ed2c48 0x1841a8460 0x183f6da1c 0x1845e8cf4 0x1840651e4 0x183f80714 0x183eaee54 0x183eaf520 0x183eaf6ec 0x181a5c76c 0x181a2d974 0x181a28efc 0x181a3c174 0x1a237b988 0x18423ea88 0x183fd7f78 0x1018d1844 0x1067b04d0)
libc++abi: terminating with uncaught exception of type NSException
### Steps to reproduce
- Create a simple app one empty scene with the godot sprite
- In godot edit enable portrait mode (see below)
- Run on an iOS device running on iOS 15 (tested on a tablet)
### Minimal reproduction project (MRP)
Only important setting in the project settings display section:
`; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="Issue"
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.2", "Mobile")
config/icon="res://icon.svg"
[display]
window/size/viewport_width=720
window/size/viewport_height=1280
window/stretch/mode="viewport"
window/stretch/aspect="expand"
window/handheld/orientation=1
[rendering]
renderer/rendering_method="mobile"
textures/vram_compression/import_etc2_astc=true
`
Contributor guide
Research direction
Reproduce the crash on an iOS 15 device using the portrait-only setting from the minimal project. Start with drivers/vulkan/vulkan_context.cpp:1837 and platform/ios/display_server_ios.mm:88, then trace the reported orientation failure. Done means the sample app creates its display server without the UIApplicationInvalidInterfaceOrientation exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, ios
- Domain
- computer-graphics, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100