beeware / beeware/toga

Toga apps may not run when built via the iOS 27 SDK onto iOS 27 simulators and devices

Closed
#4,695 2 comments 0 reactions 0 assignees View on GitHub
bug iOS
Dominant language
Python
Stars
5.4k
Forks
827
Avg merge
15h 39m
Merged PRs (30d)
40

Description

### Describe the bug

iOS 27 has changed behaviour regarding its tolerance of apps with a single-window modality. This was (it seems) foreshadowed in iOS 18 and 26 but has moved to being an assert, and therefore debug builds at least crash on launch, in iOS 27, soon to be released. (It also seems to affect release builds but I'm still getting used to Xcode.)

Apple documents their requirement at
https://developer.apple.com/documentation/uikit/transitioning-to-the-uikit-scene-based-life-cycle?language=objc

Any app, before getting into the window, crashes in UIApplicationMain(argc, argv, nil, @"PythonAppDelegate"); from the briefcase iOS template with:

failure in void _UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption(void)_block_invoke (UIApplication_RuntimeIssues.m:106) : Application failed to launch: UIScene life cycle is required for apps built with this SDK. See "Transitioning to the UIKit scene-based life cycle" in the UIKit documentation for more information on migration.

### How to reproduce the bug

1. Install macOS 27 Golden Gate RC and Xcode 27 RC and iOS 27 SDK
2. Prepare app environment as per beeware-tutorial, progress as far as "briefcase create ios"
3. Use "briefcase open ios" to open Xcode and run code from there to see the error. iOS Simulator will default to an iOS 27 device.
4. Error appears in yellow and execution pauses. Continuing crashes the app.

### Minimum example code

```shell
# No code is required, I believe any app will do this because it
# is before the Python code executes
```

### Screenshots

Image

### Environment details

- Operating system and version: macOS 27 RC Golden Gate
- Python version: 3.14 via uv
- Software versions:
- Briefcase: 0.45
- Toga: 0.5.6
- Xcode 27 RC
- iOS 27 SDK

### Logs

```
Configuring isolated Python...
Pre-initializing Python runtime...
PythonHome: /Users/joshua/Library/Developer/CoreSimulator/Devices/DCA6DBA5-E22A-401E-8530-333A9E9B7737/data/Containers/Bundle/Application/C35FC325-EC6D-4077-A7A7-508C2468C32F/MyPyStub.app/python
PYTHONPATH:
- /Users/joshua/Library/Developer/CoreSimulator/Devices/DCA6DBA5-E22A-401E-8530-333A9E9B7737/data/Containers/Bundle/Application/C35FC325-EC6D-4077-A7A7-508C2468C32F/MyPyStub.app/python/lib/python3.14
- /Users/joshua/Library/Developer/CoreSimulator/Devices/DCA6DBA5-E22A-401E-8530-333A9E9B7737/data/Containers/Bundle/Application/C35FC325-EC6D-4077-A7A7-508C2468C32F/MyPyStub.app/python/lib/python3.14/lib-dynload
- /Users/joshua/Library/Developer/CoreSimulator/Devices/DCA6DBA5-E22A-401E-8530-333A9E9B7737/data/Containers/Bundle/Application/C35FC325-EC6D-4077-A7A7-508C2468C32F/MyPyStub.app/app
Configure argc/argv...
Initializing Python runtime...
Adding app_packages as site directory: /Users/joshua/Library/Developer/CoreSimulator/Devices/DCA6DBA5-E22A-401E-8530-333A9E9B7737/data/Containers/Bundle/Application/C35FC325-EC6D-4077-A7A7-508C2468C32F/MyPyStub.app/app_packages
Running app module: mypystub
---------------------------------------------------------------------------
creating MyApp with user_documents_dir: /Users/joshua/Library/Developer/CoreSimulator/Devices/DCA6DBA5-E22A-401E-8530-333A9E9B7737/data/Containers/Data/Application/ECDF83ED-DE26-47EC-A4F8-78D38A31E005/Documents
WARNING: Can't find app icon; falling back to default icon
failure in void _UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption(void)_block_invoke (UIApplication_RuntimeIssues.m:106) : Application failed to launch: UIScene life cycle is required for apps built with this SDK. See "Transitioning to the UIKit scene-based life cycle" in the UIKit documentation for more information on migration.
Debug session ended with code 9: killed
```

### Additional context

A workaround exists, temporarily:
- Do not update devices to iOS 27
- Use Simulators based on earlier versions than iOS 27 - the Xcode/Device Hub allows Add Platform for earlier releases and I confirmed that the previous behaviour still works even with code compiled using the iOS 27 SDK.
- Continuing to use macOS 26 Tahoe/Xcode 26 is fine, but not required - I haven't tested the behaviour of apps compiled using the iOS 26 SDK being executed on a iOS 27 device (need to go home and flash forward one) but I predict it will behave like the simulator and crash.

(Separate issue, but handled a different way - iOS 27 SDK will force the minimum iOS version to 15.0 or 17.0 from briefcase's 13.0 - this is necessary for submissions to App Store Connect/TestFlight anyway.)

Pull request coming on this one.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with the Briefcase iOS template in Xcode 27 on an iOS 27 simulator, then read the Apple UIKit scene-based life-cycle documentation and inspect the UIApplicationMain entry point shown in the report. Done means a Toga app built with the iOS 27 SDK launches without the scene-lifecycle assertion while preserving support for the stated earlier configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, python
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.