-
Notifications
You must be signed in to change notification settings - Fork 4k
[firebase_messaging] Conflicts with other plugins using the PluginRegistry in GeneratedPluginRegistrant via FlutterFire's PluginRegistry.PluginRegistrantCallback #1591
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
Comments
Hi @NateNjuguna Please note that flutter_autofill is a 3rd party plugin, Thank you |
I'm using flutter_autofill just as an example, The main problem however is having plugins registered via Here's my
and
|
I'm seeing the same thing. I'm using the device_calendar plugin with the exact same error traceback. I'm on 6.0.9 version of the plugin on the master channel. Flutter (Channel master, v1.13.3-pre.23, on Microsoft Windows [Version 10.0.18362.535], locale en-US) |
Did you try the fix above? It worked for me |
I haven't tried the fix yet. |
Updated
|
I was using a really old version of the device_calendar plugin. Once I updated it my error went away. I then look at the change log and found this issue which they address for headless execution: |
It worked for me. I have used your answer to help others correct the error. At least it is a temporary solution. |
Hi, |
You save my life. Btw, Why register multiple plugins in Application.java make it crash? |
@tharit-haup see my last comment. I posted a link as to why this may be happening |
Hey @NateNjuguna I'm reviewing issues, is this still an issue or can it be closed? Looks like it's been solved with a version upgrade? |
I've been using the fix I mentioned above and it's been working so far. The version upgrade doen't help |
Hey all 👋 As part of our roadmap (#2582) we've just shipped a complete rework of the If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here. Given the scope of the rework I'm going to go ahead and close this issue in favor of trying out the latest plugin. Thanks everyone. |
io.flutter.plugins.GeneratedPluginRegistrant.registerWith doesn't work as expected when called from io.flutter.plugins.firebasemessagingFlutterFirebaseMessagingService.startBackgroundIsolate
This registrant groups together all plugins for a single registration run thus causing other plugins depending on the full class API for
io.flutter.plugin.common.PluginRegistry.Registrar
(for example: Registrar.activity() returns a null object reference) to malfunction. I believe this happens because theio.flutter.view.FlutterNativeView
created byio.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.startBackgroundIsolate
does not create a drawing surface as indicated ( Lines 154 - 165 )The call to
registerWith
receives a registry with some limited API since the aim is to provide a background service for receiving messages in the background. This however causes other plugins like flutter_autofill - which depend onRegistrar.activity()
to returnActivity
; to crumble and fail to work as expected.To Reproduce
Steps to reproduce the behavior:
com.applaudsoft.flutter_autofill.FlutterAutofillPlugin
for theregistrar.activity()
call.Expected behavior
io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.pluginRegistrantCallback.registerWith
should pass a registry that creates a valid registrar inGeneratedPluginRegistrant
compatible with other plugins (for example: plugins dependent on a drawing surface, activity e.t.c to work)Additional context
I managed to get mine working by creating a new
FirebaseCloudMessagingPluginRegistrant
and callingFirebaseMessagingPlugin.registerWith
as the only plugin registration to support the background messaging. I replacedGeneratedPluginRegistrant
with this custom registrant for in theApplication.java
found in the readme section as shown below.Also allowing the default
GeneratedPluginRegistrant
to register the plugin a second time from the defaultMainActivity.java
ensures I still get my other plugins to work as expected before adding firebase_messaging. I am not sure this is the best fix but my plugins work as expected and I assume the problem has to be with the registry provided byio.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
on line 164.FirebaseCloudMessagingPluginRegistrant.java
Application.java
MainActivity.java
The text was updated successfully, but these errors were encountered: