Skip to content

[iOS] [Engine] FlutterViewControllerTest.testStartKeyboardAnimationWillInvokeSetupKeyboardSpringAnimationIfNeeded fails on Xcode 27.2 RC #195496

Closed

Description

@preethi0228-git

Steps to reproduce

  1. Set up the Flutter Engine on an Apple Silicon Mac.
  2. Build the iOS simulator engine:

ninja -C out/ios_debug_sim_unopt_arm64 ios_test_flutter
3. Navigate to Flutter directory:
cd flutter
4. Run iOS embedding tests:
testing/run_tests.py
--type=objc
--variant host_debug_unopt_arm64
--ios-variant ios_debug_sim_unopt_arm64

Expected results

All tests should pass without any issues or errors

Actual results

The test execution crashes with a runtime error. The test results report the following test as failed:

FlutterViewControllerTest.testStartKeyboardAnimationWillInvokeSetupKeyboardSpringAnimationIfNeeded

The test does not complete successfully.

Note : All Objective-C unit tests passed in the previous Xcode 27.1 environment, but this test crashes in the current environment.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
 
[iostests.log](https://github.com/user-attachments/files/34086178/iostests.log)

[keyboard_test_ios27_2.log](https://github.com/user-attachments/files/34086200/keyboard_test_ios27_2.log)

[ios27_2_objc_tests.log](https://github.com/user-attachments/files/34086201/ios27_2_objc_tests.log)

[objcembedtestsxcode27.1.log](https://github.com/user-attachments/files/34086219/objcembedtestsxcode27.1.log)

Flutter Doctor output

Doctor output
 [✓] Flutter (Channel stable, 3.47.8, on macOS 27.2 26B5112a darwin-arm64, locale en-US) [896ms]
    • Flutter version 3.47.8 on channel stable at /Users/preethikandukuri/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 737ba8f885 (5 days ago), 2026-10-22 21:37:31 -0700
    • Engine revision cf636b1dfb
    • Dart version 3.13.7
    • DevTools version 2.60.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android,
      enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager,
      omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [1,357ms]
    • Android SDK at /Users/preethikandukuri/Library/Android/sdk
    • Emulator version 37.2.12.0 (build_id 16428233) (CL:N/A)
    • Platform android-37.0, build-tools 37.0.0
    • ANDROID_HOME = /Users/preethikandukuri/Library/Android/sdk
    • Java binary at: /Applications/Android Studio RC.app/Contents/jbr/Contents/Home/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 25.0.4+-16339643-b508.27)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 27.2) [1,450ms]
    • Xcode at /Applications/Xcode272rc.app/Contents/Developer
    • Build 27B48
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [4ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (4 available) [7.6s]
    • iPad (wireless) (mobile) • 00008122-001A08DC22B9801C            • ios            • iOS 27.2 24B115
    • iPhone 18 Pro (mobile)   • BDC18E94-3017-403A-AE89-E6FE025B9E4D • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-27-2 (simulator)
    • macOS (desktop)          • macos                                • darwin-arm64   • macOS 27.2 26B5112a
      darwin-arm64
    • Chrome (web)             • chrome                               • web-javascript • Google Chrome 156.0.8078.49

[✓] Network resources [579ms]
    • All expected network resources are available.

Activity

  1. added
    from: manual-qa
    on Oct 28, 2026
  2. added
    a: tests
    platform-ios
    engine
    has reproducible steps
    team-ios
    on Oct 28, 2026
  3. hellohuanlin commented on Oct 29, 2026

    @hellohuanlin
    Contributor

    iostests.log

    keyboard_test_ios27_2.log

    ios27_2_objc_tests.log

    objcembedtestsxcode27.1.log

    @preethi0228-git The attached log files are 404 (sorry they are valid links). Please directly paste the log in the description rather than linking to a file.

  4. preethi0228-git commented on Oct 29, 2026

    @preethi0228-git
    Author

    Hi @hellohuanlin ,

    I have copied the log trace.

     Test Case '-[FlutterViewControllerTest testStartKeyboardAnimationWillInvokeSetupKeyboardSpringAnimationIfNeeded]' started.
    2026-10-28 17:57:17.127602+0530 IosUnitTests[15162:3701917] Failed to find assets path for "NSBundle </Users/preethikandukuri/Library/Developer/CoreSimulator/Devices/876B5CC3-EB81-4604-91F2-C37455103B2C/data/Containers/Bundle/Application/41DE55F6-B133-4D13-9102-F7C40ECD8949/IosUnitTests.app> (loaded)"
    2026-10-28 17:57:17.128265+0530 IosUnitTests[15162:3701917] [UIFocus] FlutterView implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen.
    0    libios_test_flutter.dylib          0x000000010f67639c FlutterKeyboardInsetManager.startKeyBoardAnimation(_:) + 2212
    1    libios_test_flutter.dylib          0x000000010f67768c @objc FlutterKeyboardInsetManager.startKeyBoardAnimation(_:) + 52
    2    libios_test_flutter.dylib          0x000000010f519dc8 -[FlutterViewControllerTest testStartKeyboardAnimationWillInvokeSetupKeyboardSpringAnimationIfNeeded] + 3276
    3    CoreFoundation                     0x00000001c028ff70 __invoking___ + 144
    4    CoreFoundation                     0x00000001c028d0c0 -[NSInvocation invoke] + 276
    5    XCTestCore                         0x0000000105f1b5b4 +[XCTFailableInvocation invokeStandardConventionInvocation:completion:] + 56
    6    XCTestCore                         0x0000000105f1b594 __90+[XCTFailableInvocation invokeInvocation:withTestMethodConvention:lastObservedErrorIssue:]_block_invoke_3 + 24
    7    XCTestCore                         0x0000000105f1ad88 __81+[XCTFailableInvocation invokeWithAsynchronousWait:lastObservedErrorIssue:block:]_block_invoke + 292
    8    XCTestCore                         0x0000000105ed2a64 __49+[XCTSwiftErrorObservation observeErrorsInBlock:]_block_invoke + 28
    9    XCTestCore                         0x0000000105f423e0 specialized static XCTSwiftErrorObservation._observeErrors(in:) + 172
    10   XCTestCore                         0x0000000105f424c4 @objc static XCTSwiftErrorObservation._observeErrors(in:) + 28
    11   XCTestCore                         0x0000000105ed2908 +[XCTSwiftErrorObservation observeErrorsInBlock:] + 156
    12   XCTestCore                         0x0000000105f1ac00 +[XCTFailableInvocation invokeWithAsynchronousWait:lastObservedErrorIssue:block:] + 176
    13   XCTestCore                         0x0000000105f1b198 +[XCTFailableInvocation invokeInvocation:withTestMethodConvention:lastObservedErrorIssue:] + 392
    14   XCTestCore                         0x0000000105f1b62c +[XCTFailableInvocation invokeInvocation:lastObservedErrorIssue:] + 64
    15   XCTestCore                         0x0000000105f2c3b8 -[XCTestCase invokeTestMethod:] + 56
    16   XCTestCore                         0x0000000105f2c990 __24-[XCTestCase invokeTest]_block_invoke.98 + 60
    17   XCTestCore                         0x0000000105f31b38 -[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] + 144
    18   XCTestCore                         0x0000000105f2c420 -[XCTestCase invokeTest] + 476
    19   XCTestCore                         0x0000000105f2dccc __45-[XCTestCase _invokeTestIfSupportedOSVersion]_block_invoke + 32
    20   XCTestCore                         0x0000000105f31b38 -[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] + 144
    21   XCTestCore                         0x0000000105f2db28 -[XCTestCase _invokeTestIfSupportedOSVersion] + 156
    22   XCTestCore                         0x0000000105f2d578 __26-[XCTestCase performTest:]_block_invoke.125 + 324
    23   XCTestCore                         0x0000000105ece39c +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 152
    24   XCTestCore                         0x0000000105ece300 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 88
    25   XCTestCore                         0x0000000105f2d1d0 -[XCTestCase performTest:] + 236
    26   XCTestCore                         0x0000000105f29a24 -[XCTest runTest] + 44
    27   XCTestCore                         0x0000000105f378f0 -[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] + 60
    28   XCTestCore                         0x0000000105f376b8 __27-[XCTestSuite performTest:]_block_invoke + 172
    29   XCTestCore                         0x0000000105f36e44 __59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke + 40
    30   XCTestCore                         0x0000000105ece39c +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 152
    31   XCTestCore                         0x0000000105ece300 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 88
    32   XCTestCore                         0x0000000105f36d60 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 140
    33   XCTestCore                         0x0000000105f371d4 -[XCTestSuite performTest:] + 208
    34   XCTestCore                         0x0000000105f29a24 -[XCTest runTest] + 44
    35   XCTestCore                         0x0000000105f378f0 -[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] + 60
    36   XCTestCore                         0x0000000105f376b8 __27-[XCTestSuite performTest:]_block_invoke + 172
    37   XCTestCore                         0x0000000105f36e44 __59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke + 40
    38   XCTestCore                         0x0000000105ece39c +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 152
    39   XCTestCore                         0x0000000105ece300 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 88
    40   XCTestCore                         0x0000000105f36d60 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 140
    41   XCTestCore                         0x0000000105f371d4 -[XCTestSuite performTest:] + 208
    42   XCTestCore                         0x0000000105f29a24 -[XCTest runTest] + 44
    43   XCTestCore                         0x0000000105f378f0 -[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] + 60
    44   XCTestCore                         0x0000000105f376b8 __27-[XCTestSuite performTest:]_block_invoke + 172
    45   XCTestCore                         0x0000000105f36e44 __59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke + 40
    46   XCTestCore                         0x0000000105ece39c +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 152
    47   XCTestCore                         0x0000000105ece300 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 88
    48   XCTestCore                         0x0000000105f36d60 -[XCTestSuite _performProtectedSectionForTest:testSection:] + 140
    49   XCTestCore                         0x0000000105f371d4 -[XCTestSuite performTest:] + 208
    50   XCTestCore                         0x0000000105f29a24 -[XCTest runTest] + 44
    51   XCTestCore                         0x0000000105ee87f0 __89-[XCTTestRunSession executeTestsWithIdentifiers:skippingTestsWithIdentifiers:completion:]_block_invoke + 100
    52   XCTestCore                         0x0000000105ece39c +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] + 152
    53   XCTestCore                         0x0000000105ece300 +[XCTContext runInContextForTestCase:markAsReportingBase:block:] + 88
    54   XCTestCore                         0x0000000105ee85f4 -[XCTTestRunSession executeTestsWithIdentifiers:skippingTestsWithIdentifiers:completion:] + 288
    55   XCTestCore                         0x0000000105edf3b8 __72-[XCTExecutionWorker enqueueTestIdentifiersToRun:testIdentifiersToSkip:]_block_invoke_2 + 116
    56   XCTestCore                         0x0000000105ee0168 __XCTAsyncEnumerateWithWaiter_block_invoke + 212
    57   XCTestCore                         0x0000000105ee0374 __XCTAsyncEnumerate_block_invoke.99 + 52
    58   XCTestCore                         0x0000000105edf0f4 XCTAsyncEnumerateWithWaiter + 464
    59   XCTestCore                         0x0000000105edf03c __72-[XCTExecutionWorker enqueueTestIdentifiersToRun:testIdentifiersToSkip:]_block_invoke + 108
    60   XCTestCore                         0x0000000105edf4f8 -[XCTExecutionWorker runWithError:] + 68
    61   XCTestCore                         0x0000000105edd478 __25-[XCTestDriver _runTests]_block_invoke.324 + 52
    62   XCTestCore                         0x0000000105eed3d8 -[XCTestObservationCenter _observeTestExecutionForTestBundle:inBlock:] + 92
    63   XCTestCore                         0x0000000105edcc44 -[XCTestDriver _runTests] + 932
    64   XCTestCore                         0x0000000105eded6c _XCTestMain + 84
    65   libXCTestBundleInject.dylib        0x0000000104eed274 __RunTests_block_invoke_2 + 0
    66   CoreFoundation                     0x00000001c01a6244 __CFMachPortPerform + 164
    67   CoreFoundation                     0x00000001c01e62d4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
    68   CoreFoundation                     0x00000001c01e5780 __CFRunLoopDoSource1 + 476
    69   CoreFoundation                     0x00000001c01e4228 __CFRunLoopRun + 2116
    70   CoreFoundation                     0x00000001c01df2e4 _CFRunLoopRunSpecificWithOptions + 496
    71   GraphicsServices                   0x000000021d3e9938 GSEventRunModal + 116
    72   UIKitCore                          0x00000001c5466344 UIApplicationMain + 124
    73   IosUnitTests                       0x0000000104eb0af4 main + 96
    74   dyld                               0x0000000104f803c0 dyld-internal + 20
    75   <unknown>                          0x000000010514dd7c
    closure argument passed as @noescape to Objective-C has escaped: file /Users/preethikandukuri/flutter_engine_latest/flutter/engine/src/flutter/shell/platform/darwin/ios/framework/Source/KeyboardInsetManager.swift, line 365, column 19 
    2026-10-28 17:57:17.192933+0530 IosUnitTests[15162:3701917] closure argument passed as @noescape to Objective-C has escaped: file /Users/preethikandukuri/flutter_engine_latest/flutter/engine/src/flutter/shell/platform/darwin/ios/framework/Source/KeyboardInsetManager.swift, line 365, column 19
    IosUnitTests(15657,0x104729e40) malloc: enabling scribbling to detect mods to free blocks
    IosUnitTests(15657) MallocStackLogging: could not tag MSL-related memory as no_footprint, so those pages will be included in process footprint - No such file or directory (2)
    IosUnitTests(15657) MallocStackLogging: recording malloc (and VM allocation) stacks using lite mode
    
    Restarting after unexpected exit, crash, or test timeout; summary will include totals from previous launches.

    Thank you

  5. hellohuanlin commented on Oct 29, 2026

    @hellohuanlin
    Contributor

    From the log it's possibly related to Swift migration:

    2026-10-28 17:57:17.192933+0530 IosUnitTests[15162:3701917] closure argument passed as @NoEscape to Objective-C has escaped: file /Users/preethikandukuri/flutter_engine_latest/flutter/engine/src/flutter/shell/platform/darwin/ios/framework/Source/KeyboardInsetManager.swift, line 365, column 19

    cc @cbracken

  6. hellohuanlin commented on Oct 29, 2026

    @hellohuanlin
    Contributor

    From Gemini:

    The crash happens when KeyboardInsetManager.swift:365 calls UIView.animate(withDuration:animations:completion:). Swift passes the animations closure to Objective-C as a non-escaping block. When the call returns, Swift checks that nothing still holds a reference to that block.

    The test stubbed this method with OCMClassMock([UIView class]). OCMock saves every call it intercepts so it can verify it later, and that keeps the block's arguments alive. So after the call returns, the animations block is still referenced, and Swift stops the process with "closure argument passed as @NoEscape to Objective-C has escaped."

    This started when FlutterKeyboardInsetManager was ported from Objective-C to Swift in #189425. Objective-C has no such check, so the mock worked before.

  7. added
    P2
    triaged-ios
    on Oct 29, 2026
  8. cbracken commented on Nov 18, 2026

    @cbracken
    Member

    This is fixed by #196755

  9. self-assigned this
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2a: testsenginefrom: manual-qahas reproducible stepsplatform-iosteam-iostriaged-ios

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions