Skip to content

Fix iOS apps crashing at launch on iOS 27 when built with Xcode 27 - #7044

Merged
FeodorFitsner merged 3 commits into
flet-1.1.0from
fix/ios27-uiscene-launch-crash
Nov 4, 2026
Merged

FeodorFitsner merged 3 commits into
flet-1.1.0from
fix/ios27-uiscene-launch-crash

Conversation

@ndonkoHenri

@ndonkoHenri ndonkoHenri commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Apps made with flet build ipa and Xcode 27 crash at launch on iOS 27, before Python starts. The crash is in UIKit, while the app's first scene is being created:

UIKitCore  _UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption_block_invoke
UIKitCore  -[UIApplication workspace:didCreateScene:withTransitionContext:completion:]

UIKit logs the reason:

Application failed to launch: UIScene life cycle is required for apps built with this SDK.

The build itself succeeds, so the failure only shows when the app runs on iOS 27. The iOS 26.5 simulator doesn't show it, and CI builds with Xcode 26.6. The build template doesn't adopt the UIScene lifecycle, while client/ios already does.

Fix

The template now matches client/ios/Runner:

  • Info.plist: adds UIApplicationSceneManifest with FlutterSceneDelegate.
  • AppDelegate.swift: adopts FlutterImplicitEngineDelegate and registers plugins in didInitializeImplicitFlutterEngine, through engineBridge.pluginRegistry. The flutter_local_notifications registrant callback moves there too. UNUserNotificationCenter.current().delegate stays in didFinishLaunchingWithOptions.

Custom build templates need the same two changes, which the changelog notes.

Testing

Built with flet build ipa on Xcode 27.2 and Flutter 3.47.9, with no manual patching of the generated project. The app included flet-audio and flet-notifications, so the flutter_local_notifications branch of AppDelegate.swift was compiled and used.

Before and after, same app:

Build iOS 27.2 simulator iOS 26.5 simulator iPhone, iOS 27.0.1
Without the fix Crashes at launch (2 of 2 runs) Works Crashes at launch
With the fix Works, audio plays Works, audio plays Works, audio plays

"Without the fix" on the simulators is the generated project with the template's previous AppDelegate.swift restored and the scene manifest removed. The iPhone crash came from an earlier app built the same way with the previous template.

With the fix, in more detail:

Check iPhone 11 Pro Max, iOS 27.0.1 iOS 18.6 simulator
App launches Works Works
Audio plays Works Works
File picker Opens and cancels Not run
Share sheet Opens and closes Not run
Notification banner and tap Works, tap reaches on_tap Not run
Custom scheme deep link, app closed page.route is /cold?id=1 Not run
Custom scheme deep link, app running on_route_change fires Not verified, no route change logged
Switching apps and back Correct lifecycle events Not run

Older SDKs: a copy of the unfixed app with its recorded SDK version changed to 26.5 with vtool launched and played audio on the iOS 27.2 simulator, with no scene error logged. That fits UIKit's message: the requirement seems to apply to apps built with the iOS 27 SDK, so apps already built with an older Xcode should keep launching. It wasn't a real build from an older Xcode.

Not tested

  • iOS 15 to 17, and real devices other than this iPhone.
  • A real build from an older Xcode running on iOS 27. Every build here used Xcode 27.
  • Universal Links, and tapping a notification while the app is closed.
  • flet debug and flet test on a device, which use the same template.
  • Other plugins that expect the app delegate to have a window. The file picker and share plugins look up the scene's window themselves, and others weren't checked.

Summary by Sourcery

Adopt the UIScene lifecycle in generated iOS apps and align CI coverage with Xcode 27 and iOS 27.

Bug Fixes:

  • Prevent iOS apps built with Xcode 27 from crashing at launch on iOS 27 by adopting the required UIScene lifecycle in generated projects.

CI:

  • Run iOS tests on Xcode 27 using an available iOS 27 simulator runtime.

Documentation:

  • Document the required AppDelegate.swift and Info.plist updates for custom iOS build templates.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Deploying flet-website-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8a0dce7
Status: ✅  Deploy successful!
Preview URL: https://9ed89ed8.flet-website-v2.pages.dev
Branch Preview URL: https://fix-ios27-uiscene-launch-cra.flet-website-v2.pages.dev

View logs

@FeodorFitsner
FeodorFitsner merged commit 7abf07b into flet-1.1.0 Nov 4, 2026
93 checks passed
@FeodorFitsner
FeodorFitsner deleted the fix/ios27-uiscene-launch-crash branch November 4, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants