-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flutter randomly throws "StateError: Bad state: ImageStream has been disposed" on iOS/Android #110953
Comments
Hi @stx, thanks for filing the issue but there is not enough information here so we can verify the issue. |
Hi @stx Also, there was a closed issue #77576 which has been fixed before (a similar log is reported at #77576 (comment)) but this issue is still reported on flutter Before labeling the issue, please help to clarify the information indicated below:
Thank you! |
Thanks @huycozy! Images in a stack and in maps (tiles). 3.0.5. Same issue as #111342. Maybe the same as #77576. We don't use evict directly but maps use CachedNetworkImage that might. SM-S908W |
@stx Thanks for your quick response. Labeling this issue for further investigation from the team. |
@huycozy any update? We're getting quite a lot of this exception right now: The stacktrace unfortunately doesn't say precisely where the issue is happening: StacktraceNon-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Bad state: Stream has been disposed. An ImageStream is considered disposed once at least one listener has been added and subsequently all listeners have been removed and no handles are outstanding from the keepAlive method. To resolve this error, maintain at least one listener on the stream, or create an ImageStreamCompleterHandle from the keepAlive method, or create a new stream for the image.. Error thrown null. at ImageStreamCompleter._checkDisposed(image_stream.dart:602) at ImageStreamCompleter.reportImageChunkEvent(image_stream.dart:742) |
Hi @PawlikMichal25 |
Is this issue fixed in version 3.3.3 or not? |
@avinash-kanjiya @PawlikMichal25 |
We identified that this issue was caused by CachedNetworkImage (https://pub.dev/packages/cached_network_image). We replaced the caching mechanism and the production errors stopped completely. As a result, it appears that this issue may be identical to #77576. I suspect it may be due to the
|
@stx |
Can you show the code you used to solve the problem? |
@stx What's the workaround you've used? Should we expect this to be fixed from Flutter or from Also besides polluting the logs, what's the actual issue that the user is facing here? |
@huycozy are you sure it's an issue w/ flutter and not CachedNetworkImage? |
@iapicca thanks for reminding me. @stx Based on your findings in #110953 (comment), I will close this issue since it's I also see @PawlikMichal25 raised an issue on that repository with Baseflow/flutter_cached_network_image#785. So, please leave there your comment and react an upvote to the original comment will help to raise the issue. For anyone else facing this issue without using |
@stx thanks for identifying this! if you could share some hint on your workaround, it would be very helpful for us |
Deleting the package. |
Thanks for that @stx, we just followed your advice and we're a happier team now :) We jumped to https://github.com/fluttercandies/extended_image in case anyone is interested. We'll be testing it in prod during the following days but it seems to run nice for now. |
@dgilperez hi how's the https://github.com/fluttercandies/extended_image? is it causing same issue as CachedNetworkImage? |
Flawless so far, in terms of errors. I didn't do any proper benchmark to compare them. It just works for us |
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 |
We upgraded to Flutter 3.3.0 and we're rarely seeing a new error on production apps with both iOS and Android users. It seems more common on Android. We've seen it be triggered when background the app, when a device is low or out of memory, and while using the app normally.
Steps to Reproduce
We're not able to reproduce it.
The text was updated successfully, but these errors were encountered: