Skip to content
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

[firebase_database] No implementation found for method cancel #13513

Open
1 task done
PhanVanLinh opened this issue Oct 18, 2024 · 2 comments
Open
1 task done

[firebase_database] No implementation found for method cancel #13513

PhanVanLinh opened this issue Oct 18, 2024 · 2 comments
Labels
Needs Attention This issue needs maintainer attention. platform: android Issues / PRs which are specifically for Android. plugin: messaging type: bug Something isn't working

Comments

@PhanVanLinh
Copy link

PhanVanLinh commented Oct 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Messaging

Which platforms are affected?

Android

Description

This issue is similar to #7795, but the issue is closed.
The crashlog in Firebase and Sentry is

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: MissingPluginException(No implementation found for method cancel on channel prices/ABC-[DEFAULT]-null-DatabaseEventType.value-[]#38). Error thrown .
at MethodChannel._invokeMethod(platform_channel.dart:332)
at EventChannel.receiveBroadcastStream.<fn>(platform_channel.dart:688)

We're using the Firebase database on a single screen with StreamBuilder, without much complex logic like

@override
Widget build(BuildContext context) {
  return StreamBuilder(
              stream: _databaseRef.child('prices').child(name).onValue,
              builder: (BuildContext context, snapshot) {
                  ...
              }
   };           
}

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
image

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#L359

Android 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 or didReinitializeFirebaseCore.

I think the above issue can only happens if onDetachedFromEngine or didReinitializeFirebaseCore 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

@PhanVanLinh PhanVanLinh added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Oct 18, 2024
@SelaseKay SelaseKay added plugin: messaging platform: android Issues / PRs which are specifically for Android. labels Oct 18, 2024
@SelaseKay
Copy link
Contributor

Hi @PhanVanLinh , thanks for the report. Is this the entire log?

@SelaseKay SelaseKay added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Oct 18, 2024
@PhanVanLinh
Copy link
Author

@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

@google-oss-bot google-oss-bot removed the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention This issue needs maintainer attention. platform: android Issues / PRs which are specifically for Android. plugin: messaging type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants