michael-cheung-thebus / foreground_service

Other
43 stars 29 forks source link

Migrate to Flutter 1.12 #8

Closed Informateur closed 4 years ago

Informateur commented 4 years ago

In flutter 1.12 GeneratedPluginRegistrant.registerWith(p0) method returns an error:

Type mismatch: inferred type is PluginRegistry? but FlutterEngine was expected

How can this conflict be resolved in the new version?

Informateur commented 4 years ago

It works if replaced: override fun registerWith(p0: PluginRegistry) {ForegroundServicePlugin.registerWith(p0.registrarFor("org.thebus.foreground_service.ForegroundServicePlugin"))}

michael-cheung-thebus commented 4 years ago

@Informateur v1.1.0 has been published, give it a shot.

After the Flutter 1.12 changes, you shouldn't need to do anything on the Android side besides have the notification icon - in other words, you can delete the custom application class etc. etc.

Informateur commented 4 years ago

I knew there was an elegant way. Thanks a lot!