-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Steps to reproduce
- Use the testing app from the samples repo https://github.com/flutter/samples/tree/main/testing_app
- Observe that UIKit is imported before Flutter in the
AppDelegate.swiftfile - Run
flutter config --enable-uiscene-migration - Run the app on iOS
Expected results
The migration for UIScene is successful
Actual results
Migration fails and you see a message similar to To ensure your app continues to launch on upcoming iOS versions, UIScene lifecycle support will soon be required. Please see https://flutter.dev/to/uiscene-migration for the migration guide. in your logs.
The actual reason for the failure is not present unless you run in verbose mode. UIScene migration: AppDelegate does not match original template. is the reason it does not work.
When the order of the imports is reversed, (i.e, Flutter before UIKit), the migration works as expected.
I think the script for running the migration assumes that flutter is always imported before UIKit (which might be the case in recent times) but there are a few apps which do not have the order of the imports in the way the script is expecting. Example
https://github.com/flutter/samples/blob/460d6f9b08628c798ed9e9dded01f065b5d5534c/testing_app/ios/Runner/AppDelegate.swift#L1-L2
The import order was changed in #141487
Attached below are logs that capture what happens in both cases (UIKit before Flutter, Flutter before UIKit)
Code sample
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
flutter_before_uikit.log
uikit_before_flutter.log
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.38.2, on macOS 26.2 25C5048a darwin-arm64, locale en-US) [924ms]
• Flutter version 3.38.2 on channel stable at /Users/deanli/dev/stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f5a8537f90 (3 days ago), 2025-11-18 09:27:21 -0500
• Engine revision b5990e5ccc
• Dart version 3.10.0
• DevTools version 2.51.1
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [3.1s]
• Android SDK at /Users/deanli/Library/Android/sdk
• Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
• Platform android-36.1, build-tools 36.1.0
• Java binary at: /Users/deanli/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [2.2s]
• Xcode at /Applications/Xcode-26.2.0-beta.2.app/Contents/Developer
• Build 17C5038g
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [9ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (5 available) [9.8s]
• iPhone 16 Pro Max (mobile) • 00008140-00194CC23A68801C • ios • iOS 26.2 23C5044b
• Dean iPad (wireless) (mobile) • 00008103-000825C811E3401E • ios • iOS 26.2 23C5044b
• iPhone 17 Pro (mobile) • 0FF7BACD-66AE-4185-9E5D-9982685982C4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-26-2 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 26.2 25C5048a darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.176
! Error: Browsing on the local area network for Nexus. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [947ms]
• All expected network resources are available.
• No issues found![!] Flutter (Channel master, 3.39.0-1.0.pre-234, on macOS 26.2 25C5048a darwin-arm64, locale en-US) [2.8s]
• Flutter version 3.39.0-1.0.pre-234 on channel master at /Users/deanli/dev/master
! Warning: `flutter` on your path resolves to /Users/deanli/dev/stable/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/deanli/dev/master. Consider adding /Users/deanli/dev/master/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/deanli/dev/stable/bin/dart, which is not inside your current Flutter SDK checkout at /Users/deanli/dev/master. Consider adding /Users/deanli/dev/master/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision bb1746ddbd (6 hours ago), 2025-11-20 20:11:08 -0500
• Engine revision bb1746ddbd
• Dart version 3.11.0 (build 3.11.0-158.0.dev)
• DevTools version 2.52.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-windowing, enable-lldb-debugging, enable-uiscene-migration
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [2.5s]
• Android SDK at /Users/deanli/Library/Android/sdk
• Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
• Platform android-36.1, build-tools 36.1.0
• Java binary at: /Users/deanli/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [1,728ms]
• Xcode at /Applications/Xcode-26.2.0-beta.2.app/Contents/Developer
• Build 17C5038g
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [6ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (5 available) [7.9s]
• iPhone 16 Pro Max (mobile) • 00008140-00194CC23A68801C • ios • iOS 26.2 23C5044b
• Dean iPad (wireless) (mobile) • 00008103-000825C811E3401E • ios • iOS 26.2 23C5044b
• iPhone 17 Pro (mobile) • 0FF7BACD-66AE-4185-9E5D-9982685982C4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-26-2 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 26.2 25C5048a darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.176
! Error: Browsing on the local area network for Nexus. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [939ms]
• All expected network resources are available.
! Doctor found issues in 1 category.
fya @vashworth