-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
What happened?
I'm getting these errors through crashlytics, so I don't know the exact extent of these crashes.
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Bad state: A Dart object attempted to access a native peer, but the native peer has been collected (nullptr). This is usually the result of calling methods on a native-backed object when the native resources have already been disposed.
at Image.dispose(dart:ui)
at TextBoxComponent.redraw.<fn>(text_box_component.dart:345)
What do you expect?
No error. Disposal can be validated before calling dispose.
How can we reproduce this?
I am not entirely sure, because I am not the end user. I do receive a non trivial error reports from crashlytics on this.
"This issue has 86 crash events affecting 39 users" in past 24 hours.
What steps should take to fix this?
Potentially...(?)
if (cachedToRemove.add(cachedImage)) {
Future.delayed...
}
Do have an example of where the bug occurs?
My stacktrace from my reporting tool is too shallow and unfortunately doesn't have the parent caller of the class.
Relevant log output
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Bad state: A Dart object attempted to access a native peer, but the native peer has been collected (nullptr). This is usually the result of calling methods on a native-backed object when the native resources have already been disposed.
at Image.dispose(dart:ui)
at TextBoxComponent.redraw.<fn>(text_box_component.dart:345)Execute in a terminal and put output into the code block below
Output of: flutter doctor -v
[✓] Flutter (Channel stable, 3.32.7, on macOS 15.1 24B2083 darwin-arm64, locale en-US) [583ms]
• Flutter version 3.32.7 on channel stable at /Users/macbook/development/flutter
• Upstream repository git@github.com:flutter/flutter.git
• Framework revision d7b523b356 (10 weeks ago), 2025-07-15 17:03:46 -0700
• Engine revision 39d6d6e699
• Dart version 3.8.1
• DevTools version 2.45.1
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.1s]
• Android SDK at /Users/macbook/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• 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.3+-79915917-b509.11)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 16.1) [1,334ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16B40
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [82ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.2) [82ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
Affected platforms
Android, iOS
Other information
flame: 1.32.0
Are you interested in working on a PR for this?
- I want to work on this