Skip to content

iOS app crashes when running on Apple Silicon Mac #159639

@ekuleshov

Description

@ekuleshov

Steps to reproduce

  1. An iOS app is build and published to the Apple App store
  2. Users install it on Apple Silicone Mac device
  3. We are receiving crash reports in Crashlytics from user's devices

I wasn't been able to reproduce this locally. There are references to PlatformViews in the code and the only platform view's in the app are from the webview_flutter iOS plugin.

The app is built using the current latest stable Flutter version. See the doctor output below.

Expected results

The app should not crash when it is running on Apple Silicone Mac devices.

Actual results

The crash seems to be coming from some FlutterEngine internals native code, e.g. EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000000006d0 See logs below

Code sample

Code sample
N/A

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000000006d0

0  Flutter                        0x11b28 -[FlutterEngine platformView] + 53 (weak_ptr.h:53)
1  Flutter                        0x11994 -[FlutterEngine updateViewportMetrics:] + 186 (ref_ptr.h:186)
2  Flutter                        0x1f854 -[FlutterViewController updateViewportMetricsIfNeeded] + 427 (vector:427)
3  Flutter                        0x1f9b8 -[FlutterViewController viewDidLayoutSubviews] + 1411 (FlutterViewController.mm:1411)
4  UIKitCore                      0x8c864 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2376
5  QuartzCore                     0x1fa0c CA::Layer::layout_if_needed(CA::Transaction*) + 516
6  QuartzCore                     0x1ae84c CA::Context::commit_transaction(CA::Transaction*, double, double*) + 516
7  QuartzCore                     0x2888 CA::Transaction::commit() + 648
8  AppKit                         0xb38848 __37+[NSDisplayCycle currentDisplayCycle]_block_invoke.7 + 44
9  AppKit                         0xb38c94 ___NSMainRunLoopPerformBlockInModes_block_invoke + 44
10 CoreFoundation                 0x7d8c0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
11 CoreFoundation                 0x7d7d0 __CFRunLoopDoBlocks + 356
12 CoreFoundation                 0x7cc00 __CFRunLoopRun + 2432
13 CoreFoundation                 0x7bbc4 CFRunLoopRunSpecific + 588
14 HIToolbox                      0x10bf64 RunCurrentEventLoopInMode + 292
15 HIToolbox                      0x111d54 ReceiveNextEventCommon + 636
16 HIToolbox                      0x111eb8 _BlockUntilNextEventMatchingListInModeWithFilter + 76
17 AppKit                         0x3aa08 _DPSNextEvent + 660
18 AppKit                         0x97ae0c -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688
19 AppKit                         0x24f680 -[NSApplication _shouldTerminate] + 1124
20 AppKit                         0x2427ec -[NSApplication terminate:] + 848
21 Foundation                     0x78fe8 __NSFireDelayedPerform + 372
22 CoreFoundation                 0x97824 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
23 CoreFoundation                 0x974c8 __CFRunLoopDoTimer + 1012
24 CoreFoundation                 0x96fd8 __CFRunLoopDoTimers + 356
25 CoreFoundation                 0x7c9c0 __CFRunLoopRun + 1856
26 CoreFoundation                 0x7bbc4 CFRunLoopRunSpecific + 588
27 HIToolbox                      0x10bf64 RunCurrentEventLoopInMode + 292
28 HIToolbox                      0x111d54 ReceiveNextEventCommon + 636
29 HIToolbox                      0x111eb8 _BlockUntilNextEventMatchingListInModeWithFilter + 76
30 AppKit                         0x3aa08 _DPSNextEvent + 660
31 AppKit                         0x97ae0c -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688
32 AppKit                         0x2dae0 -[NSApplication run] + 480
33 AppKit                         0x4364 NSApplicationMain + 888
34 AppKit                         0x252870 _NSApplicationMainWithInfoDictionary + 22
35 UIKitMacHelper                 0x4b38 UINSApplicationMain + 972
36 UIKitCore                      0x43a8 UIApplicationMain + 148
37 UIKitCore                      0x49e01c block_destroy_helper.23 + 11736
38 Runner                         0x872c main + 4369614636 (AppDelegate.swift:4369614636)
39 ???                            0x199e4c274 (Missing)

Flutter Doctor output

Doctor output
> flutter doctor -v
[✓] Flutter (Channel stable, 3.24.5, on macOS 13.6.6 22G630 darwin-arm64, locale en-CA)
    • Flutter version 3.24.5 on channel stable at ***
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision dec2ee5c1f (2 weeks ago), 2024-11-13 11:13:06 -0800
    • Engine revision a18df97ca5
    • Dart version 3.5.4
    • DevTools version 2.37.3

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode_15.2.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.15.2

[✓] IntelliJ IDEA Ultimate Edition (version 2024.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 82.2.4
    • Dart plugin version 243.22562.3

[✓] Connected device (6 available)
    • macOS (desktop)                    • macos                                • darwin-arm64   • macOS 13.6.6 22G630 darwin-arm64
    • Mac Designed for iPad (desktop)    • mac-designed-for-ipad                • darwin         • macOS 13.6.6 22G630 darwin-arm64

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

Metadata

Metadata

Assignees

Labels

a: platform-viewsEmbedding Android/iOS views in Flutter appsa: productionIssues experienced in live production appsc: crashStack traces logged to the consoleneeds repro infoAutomated crash report whose cause isn't yet knownplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions