Repository navigation
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.needs repro infoAutomated crash report whose cause isn't yet knownAutomated crash report whose cause isn't yet knownp: video_playerThe Video Player pluginThe Video Player pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Steps to reproduce
Unfortunately i can't reproduce it, it's a crash i have received from Crashlytics.
I am attaching here the whole trace.txt
Here is the Gemini insight :
// In your AppDelegate.swift or similar
import Flutter
@UIApplicationMain
class AppDelegate: FlutterAppDelegate {
// Assuming you have a reference to your FlutterEngine or FlutterViewController
// let flutterEngine = FlutterEngine(name: "my_engine")
// var flutterViewController: FlutterViewController?
override func applicationDidEnterBackground(_ application: UIApplication) {
// Pause any Flutter rendering or intensive operations
// This is conceptual; actual implementation depends on Flutter's API for pausing rendering
// You might need to send a platform channel message to your Flutter code to stop drawing.
// Example:
// if let controller = self.flutterViewController {
// let channel = FlutterMethodChannel(name: "com.example.app/background", binaryMessenger: controller.binaryMessenger)
// channel.invokeMethod("onAppBackground", arguments: nil)
// }
// Or, if Flutter has a direct API for pausing rendering when backgrounded:
// self.flutterEngine.pauseRendering() // (Hypothetical API)
}
override func applicationWillEnterForeground(_ application: UIApplication) {
// Resume Flutter rendering or intensive operations
// Example:
// if let controller = self.flutterViewController {
// let channel = FlutterMethodChannel(name: "com.example.app/background", binaryMessenger: controller.binaryMessenger)
// channel.invokeMethod("onAppForeground", arguments: nil)
// }
// self.flutterEngine.resumeRendering() // (Hypothetical API)
}
}import 'package:flutter/widgets.dart';
class MyFlutterApp extends StatefulWidget {
@override
_MyFlutterAppState createState() => _MyFlutterAppState();
}
class _MyFlutterAppState extends State<MyFlutterApp> with WidgetsBindingObserver {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.inactive || state == AppLifecycleState.paused) {
// The app is going to the background or is suspended.
// Stop any active texture updates, video rendering, or other intensive tasks.
// This might involve pausing a video player, stopping a game loop, etc.
print('App is inactive/paused, stopping texture updates.');
} else if (state == AppLifecycleState.resumed) {
// The app is coming back to the foreground.
// Resume any previously paused operations.
print('App is resumed, resuming texture updates.');
}
}
@override
Widget build(BuildContext context) {
return Container(); // Your main app content
}
}
Expected results
The app should not crash
Actual results
The app is crashing
Code sample
Code sample
[Paste your code here]Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
Crashed: com.apple.main-thread
0 Flutter 0x23abc -[FlutterEngine textureFrameAvailable:] + 84 (ref_ptr.h:84)
1 Flutter 0x59908 -[FlutterTextureRegistryRelay textureFrameAvailable:] + 34 (FlutterTextureRegistryRelay.mm:34)
2 video_player_avfoundation 0x5660 -[FVPFrameUpdater displayLinkFired] + 17 (FVPFrameUpdater.m:17)
3 video_player_avfoundation 0x4be4 -[FVPDisplayLinkTarget onDisplayLink:] + 33 (FVPCADisplayLink.m:33)
4 QuartzCore 0xbe924 CA::Display::DisplayLinkItem::dispatch_(CA::SignPost::Interval<(CA::SignPost::CAEventCode)835322056>&) + 64
5 QuartzCore 0x9bf38 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 880
6 QuartzCore 0xaf770 CA::Display::DisplayLink::dispatch_deferred_display_links(unsigned int) + 360
7 UIKitCore 0x7dee4 _UIUpdateSequenceRunNext + 128
8 UIKitCore 0x7d374 schedulerStepScheduledMainSectionContinue + 60
9 UpdateCycle 0x1560 UC::DriverCore::continueProcessing() + 84
10 CoreFoundation 0x68f10 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
11 CoreFoundation 0x68e84 __CFRunLoopDoSource0 + 172
12 CoreFoundation 0x46b30 __CFRunLoopDoSources0 + 332
13 CoreFoundation 0x1d6d8 __CFRunLoopRun + 820
14 CoreFoundation 0x1ca6c _CFRunLoopRunSpecificWithOptions + 532
15 GraphicsServices 0x1498 GSEventRunModal + 120
16 UIKitCore 0x9ddf8 -[UIApplication _run] + 792
17 UIKitCore 0x46e54 UIApplicationMain + 336
18 UIKitCore 0x172820 -[UIScrollView contentInset] + 588
19 Runner 0x8bb4 main + 4341402548 (AppDelegate.swift:4341402548)
20 ??? 0x18ab6ae28 (Missing)
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.41.7, on macOS 26.4.1 25E253 darwin-arm64, locale fr-FR) [2,2s]
• Flutter version 3.41.7 on channel stable at /Users/foxtom/Desktop/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cc0734ac71 (11 days ago), 2026-04-15 21:21:08 -0700
• Engine revision 59aa584fdf
• Dart version 3.11.5
• DevTools version 2.54.2
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging,
enable-uiscene-migration
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [13,2s]
• Android SDK at /Users/foxtom/Library/Android/sdk
• Emulator version 36.5.11.0 (build_id 15261927) (CL:N/A)
• Platform android-36, build-tools 36.1.0
• ANDROID_HOME = /Users/foxtom/Library/Android/sdk
• Java binary at: /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.10+-117844308-b1163.108)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.4.1) [4,4s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17E202
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [9ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (2 available) [6,6s]
• macOS (desktop) • macos • darwin-arm64 • macOS 26.4.1 25E253 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 147.0.7727.117
[✓] Network resources [299ms]
• All expected network resources are available.
• No issues found!Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.needs repro infoAutomated crash report whose cause isn't yet knownAutomated crash report whose cause isn't yet knownp: video_playerThe Video Player pluginThe Video Player pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Activity
saurabh-mirajkar commentedon Apr 27, 2026
@Tom3652 Thanks for the detailed report. This appears to be similar to #101488.
Keeping this open for now since there isn’t enough information yet to confirm it’s the same root cause.
Could you please share:
video_playerplugin versionTom3652 commentedon Apr 27, 2026
hi @saurabh-mirajkar !
It seems similar by the consequence but i highly doubt the cause is the same.
I am using flutter
3.41.7and the video_player: ^2.11.1-> i can't reproduce it locally i have tried many times but unable to...
saurabh-mirajkar commentedon Apr 28, 2026
@Tom3652 Thanks for the additional details.
Since this has only occurred once and is not reproducible, it’s difficult to confirm whether this is the same root cause as #101488 or a separate issue.
For now, we’ll keep this open and labeled for further triage. If you encounter this again, please try to capture:
3 remaining items
Piinks commentedon May 4, 2026
team-iosSGTM, removing needs additional triage while it make its way to their triage meeting. Thanks!Dhanushya-Sasidharan commentedon Jun 26, 2026
Is there any fix for this crash from video_player_avfoundation plugin? I am also facing this crash and it's not reproducible. While the production app is crashing randomly several times and the crash rate is very high in firebase crashlytics for all iOS versions from 17 to 26 versions. Also we are facing this issue after we incorporated scene delegate in our app. Kindly help me on this issue.
LahaLuhem commentedon Sep 1, 2026
@Tom3652 @Dhanushya-Sasidharan I managed to make reprodude it deterministically.
flutter create ...AppDelegate.swift(self-contained)2 ways to fix it?
unregisterTexture:andtextureFrameAvailable:the wayregisterTexturealready effectively is, by routing them through theplatformViewgetter and returning early.destroyContextpath, so a plugin can stop producing frames deliberately instead of racing. More complete, since a plugin currently gets no signal at all.ios: Return NO from run* calls on a running/terminated engine
ios: Return NO from run* calls on a running/terminated engine
ios: Return NO from run* calls on a running/terminated engine
cbracken commentedon Sep 9, 2026
I've got a patch out in #192465 that I believe should fix this.
The callback in question is happening on the raster thread and[FlutterEngine destroyContext]happens on the platform thread and there's currently no synchronisation happening on the state in question, so I'll need to send a followup, but this should help.Edit: on further digging, I'm misremembering. This callback does happen on the platform thread, as does
destroyContextteardown, so my patch should fix this crash. It wascopyPixelBufferthat's fired on the raster thread.As @LahaLuhem mentions, we really should have a teardown notification for plugins that need to manage their state but the embedder should also handle things gracefully.
ios: Return NO from run* calls on a running/terminated engine
ios: Return NO from run* calls on a running/terminated engine (flutte…
github-actions commentedon Sep 24, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.