Open PhanVanLinh opened 3 days ago
Hi @PhanVanLinh , thanks for the report. Is this the entire log?
@SelaseKay yes, this is the entire log. we can attach more information by intercepting this exception before sending it to Sentry/Firebase, but we don't know what additional info should include, as the crash line internally from platform_channel
Is there an existing issue for this?
Which plugins are affected?
Messaging
Which platforms are affected?
Android
Description
This issue is similar to https://github.com/firebase/flutterfire/issues/7795, but the issue is closed. The crashlog in Firebase and Sentry is
We're using the Firebase database on a single screen with StreamBuilder, without much complex logic like
Currently, we can not reproduce the issue in development, but it's still happens to thousands users everyday. The issue mainly happens on Samsung device and Android 14
I have checked the
FirebaseDatabasePlugin.java
, Android create the channel and Flutter receive the channel from Android https://github.com/firebase/flutterfire/blob/main/packages/firebase_database/firebase_database/android/src/main/java/io/flutter/plugins/firebase/database/FirebaseDatabasePlugin.java#L359Android only remove in cleanUp https://github.com/firebase/flutterfire/blob/main/packages/firebase_database/firebase_database/android/src/main/java/io/flutter/plugins/firebase/database/FirebaseDatabasePlugin.java#L601
And clean cleanUp is only get called when
onDetachedFromEngine
ordidReinitializeFirebaseCore
.I think the above issue can only happens if
onDetachedFromEngine
ordidReinitializeFirebaseCore
get called before Stream get cancel but I don't know if it's possible or not. If you need more detailed information about the issue, I can add more data to the Sentry log and send it after the next release.Reproducing the issue
We are unable to reproduce this issue; it happens randomly for users.
Firebase Core version
2.32.0
Flutter Version
3.24.0
Relevant Log Output
No response
Flutter dependencies
firebase_auth: ^4.20.0 firebase_core: ^2.32.0 firebase_messaging: ^14.9.4 firebase_database: ^10.5.7 firebase_crashlytics: ^3.5.7 firebase_remote_config: ^4.4.7
android targetSDK:34
Additional context and comments
No response