Tool: Provide guided migration logs when iOS app crashes due to missi… by okorohelijah · Pull Request #188556 · flutter/flutter · GitHub
Skip to content

Tool: Provide guided migration logs when iOS app crashes due to missi…#188556

Open
okorohelijah wants to merge 3 commits into
flutter:masterfrom
okorohelijah:fix-uiscene-crash-log-interception
Open

Tool: Provide guided migration logs when iOS app crashes due to missi…#188556
okorohelijah wants to merge 3 commits into
flutter:masterfrom
okorohelijah:fix-uiscene-crash-log-interception

Conversation

@okorohelijah

@okorohelijah okorohelijah commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

When an unmigrated iOS app runs on iOS 27+, it immediately crashes on launch because the UIScene lifecycle is required.

List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.

Fixes #187758

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

…ng UIScene lifecycle

- Populate UserMessages.uiSceneMigrationWarning with a helpful migration guide.

- Update devicectl _ignorePatterns in core_devices.dart to preserve UIScene crash logs.

- Add uiscene_crash LogInterceptor to IOSDevice to catch the crash and throw a guided ToolExit.

- Add unit tests verifying the log interception and exit behavior.

Fixes flutter#187758
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 25, 2026
@github-actions github-actions Bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. team-ios Owned by iOS platform team labels Jun 25, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 25, 2026
@okorohelijah okorohelijah added the CICD Run CI/CD label Jun 25, 2026
@okorohelijah okorohelijah marked this pull request as ready for review June 25, 2026 16:11
@okorohelijah okorohelijah requested a review from a team as a code owner June 25, 2026 16:11
@okorohelijah okorohelijah requested a review from vashworth June 25, 2026 16:12

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the iOS device logging and error handling to detect and handle UIScene lifecycle requirements. Specifically, it changes 'uiSceneMigrationWarning' to a non-nullable getter, adds a log interceptor to throw a 'ToolExit' when a UIScene crash log is detected, and updates the relevant tests. Feedback on these changes highlights a typo in the warning message referring to 'iOS 27' instead of 'iOS 18', and notes that the documentation comment for the public 'uiSceneMigrationWarning' getter was mistakenly removed.

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.

high

The message states that UIScene lifecycle is required on iOS 27, which is likely a typo for iOS 18. iOS 18 is the version where the UIScene lifecycle requirement was introduced by Apple.

Suggested change
UIScene lifecycle is required on iOS 27 and later.
UIScene lifecycle is required on iOS 18 and later.

/// Overridable message to be shown when detected from device logs that UIScene migration is
/// still required.
String? uiSceneMigrationWarning;
String get uiSceneMigrationWarning => '''

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.

medium

The documentation comment for uiSceneMigrationWarning was removed. According to the Repository Style Guide, all public members should have documentation.

Suggested change
String get uiSceneMigrationWarning => '''
/// Overridable message to be shown when detected from device logs that UIScene migration is
/// still required.
String get uiSceneMigrationWarning => '''
References
  1. All public members should have documentation. (link)

@okorohelijah

Copy link
Copy Markdown
Contributor Author

Proposed future improvement in #188557

@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 25, 2026
@okorohelijah okorohelijah added the CICD Run CI/CD label Jun 25, 2026
@@ -344,7 +344,7 @@ class IOSCoreDeviceControl {
// * Don't ignore flutter logs:
// 2025-09-16 12:50:07.953318-0500 Runner[1279:149305] flutter: ...
RegExp(
r'^\S* \S* \S*\[[0-9:]*] ((?!(\[INFO|\[WARNING|\[ERROR|\[IMPORTANT|\[FATAL):))(?!(flutter:))(?!(\[UIKit App Config\] `UIScene` lifecycle)).*',
r'^\S* \S* \S*\[[0-9:]*] ((?!(\[INFO|\[WARNING|\[ERROR|\[IMPORTANT|\[FATAL):))(?!(flutter:))(?!(\[UIKit App Config\] `UIScene` lifecycle))(?!.*UIScene life\s?cycle).*',

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.

Is this needed?

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.

Don't use this variable for your error. This is for internal usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD platform-ios iOS applications specifically team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide guided logs when app crashes due to UIScene on iOS 27

2 participants