title: firebase-messaging - Fatal: failed to find callback
body: <p>I'm trying to use FCM messaging and keep getting this error.</p>
  <p><code>E/FlutterFcmService( 3684): Fatal: failed to find callback</code></p>
  <p>Below is the code I've used to setup.</p>
  <pre><code>  static Future&lt;void&gt; messagePiper(
        Map&lt;String, dynamic&gt; message,
        FilteredMap&lt;String, ChatMessage&gt; globalChatEntryMap,
        FilteredMap&lt;String, ChatMessage&gt; gameChatEntryMap,
        Subject&lt;List&lt;ChatMessage&gt;&gt; globalChatSubject,
        Subject&lt;List&lt;ChatMessage&gt;&gt; gameChatSubject,
        Map&lt;String, Player&gt; _playerMap) async {
      final Map&lt;String, dynamic&gt; data = message['data'];
      if (data.containsKey('name')) {
        final msg = ChatMessage.fromMap(data);
        globalChatEntryMap.putIfAbsent(msg.id, () =&gt; msg);
        globalChatSubject.add(globalChatEntryMap.values.toList());
      } else {
        final msg = GameChatMessage.fromMap(data);
  
        final chat = ChatMessage.fromGlobalChatMessage(
          msg,
          _playerMap[msg.pId].name,
          _playerMap[msg.pId].imageUrl,
        );
  
        print('chat: $chat');
        gameChatEntryMap.putIfAbsent(msg.id, () =&gt; chat);
        print('_gameChatEntryMap : $gameChatEntryMap');
        gameChatSubject.add(gameChatEntryMap.values.toList());
      }
  
      return Future&lt;void&gt;.value();
    }
  </code></pre>
  <p>is the callback passed in to <code>FirebaseMessaging</code> configuration.</p>
  <pre><code>  final FirebaseMessaging _fm = FirebaseMessaging();
  
    @override
    void initState() {
  
     _fm.configure(
          onMessage: (Map&lt;String, dynamic&gt; message) async {
            print('onMessagee : $message');
            return Utils.messagePiper(
                message,
                _globalChatEntryMap,
                _gameChatEntryMap,
                _globalChatSubject,
                _gameChatSubject,
                _playerMap);
          },
          onLaunch: (Map&lt;String, dynamic&gt; message) async {
            print('onLaunch : $message');
            return Utils.messagePiper(
                message,
                _globalChatEntryMap,
                _gameChatEntryMap,
                _globalChatSubject,
                _gameChatSubject,
                _playerMap);
            ;
          },
          onResume: (Map&lt;String, dynamic&gt; message) async {
            print('onResume : $message');
            return Utils.messagePiper(
                message,
                _globalChatEntryMap,
                _gameChatEntryMap,
                _globalChatSubject,
                _gameChatSubject,
                _playerMap);
            ;
          },
          onBackgroundMessage: null);
  ....
  </code></pre>
  <p>Java configuration file</p>
  <pre><code>package io.flutter.plugins;
  
  import io.flutter.app.FlutterApplication;
  import io.flutter.plugin.common.PluginRegistry;
  import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
  import io.flutter.plugins.GeneratedPluginRegistrant;
  import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
  
  public class Application extends FlutterApplication implements PluginRegistrantCallback {
      @Override
      public void onCreate() {
          super.onCreate();
          FlutterFirebaseMessagingService.setPluginRegistrant(this);
      }
  
      @Override
      public void registerWith(PluginRegistry registry) {
          GeneratedPluginRegistrant.registerWith(registry);
      }
  }
  </code></pre>
  <p>dependency versions</p>
  <pre><code>  random_string: 0.0.2
    firebase_auth: ^0.14.0+5
    firebase_database: ^3.0.7
    provider: 3.0.0
    rxdart: ^0.22.2
    collection: ^1.14.11
    audioplayers: ^0.13.2
    firebase_admob: ^0.5.5
    connectivity: ^0.4.4
    firebase_messaging: ^5.1.6 # tried with several different versions
  </code></pre>
  <p>I tried with several <code>firebase_messaging</code> versions but couldn't find a fix.</p>
  <p>Appreciate any help to solve this issue.</p>