Plugin crashes when registering plugins via calling GeneratedPluginRegistrant.registerWith(flutterEngine). Registration of plugins is performed when app runs in background e.g. Service handle some platform Intent and starts headless FlutterEngine that executes some dart code.
E/AndroidRuntime(23578): Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.BinaryMessenger.setMessageHandler(java.lang.String, io.flutter.plugin.common.BinaryMessenger$BinaryMessageHandler)' on a null object reference
E/AndroidRuntime(23578): at io.flutter.plugin.common.MethodChannel.setMethodCallHandler(MethodChannel.java:119)
E/AndroidRuntime(23578): at com.github.mingchen.flutter.plugins.ios_app_group.IosAppGroupPlugin.registerWith(IosAppGroupPlugin.java:14)
ios_app_group plugin uses Android v1 embedding api.
Our app already has been migrated to use v2 Android embedding.
Plugin crashes when registering plugins via calling
GeneratedPluginRegistrant.registerWith(flutterEngine)
. Registration of plugins is performed when app runs in background e.g. Service handle some platform Intent and starts headless FlutterEngine that executes some dart code.ios_app_group
plugin uses Android v1 embedding api. Our app already has been migrated to use v2 Android embedding.Problem disappear if plugin migrated to android v2 embedding. All migration steps are described here https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration