FlutterGeofencing icon indicating copy to clipboard operation
FlutterGeofencing copied to clipboard

Type mismatch on a clean project (PluginRegistry instead of FlutterEngine)

Open paolorotolo opened this issue 4 years ago • 6 comments

Following the steps in REAMDE and including the plugin from git, I'm unable to compile the sources in a clean project.

It only compiles if I replace

    override fun registerWith(registry: PluginRegistry) {
        GeneratedPluginRegistrant.registerWith(registry);
    }

with

    override fun registerWith(registry: PluginRegistry) {
        registry.registrarFor("io.flutter.plugins.geofencing.GeofencingPlugin")
    }

in Application.kt

Log:

Application.kt: (17, 48): Type mismatch: inferred type is PluginRegistry but FlutterEngine was expected

paolorotolo avatar Mar 29 '20 14:03 paolorotolo

Yes, if you're using a recently created Flutter project the Android implementation is slightly different due to an API change. This needs to be updated still.

bkonyi avatar Apr 13 '20 18:04 bkonyi

Yes, if you're using a recently created Flutter project the Android implementation is slightly different due to an API change. This needs to be updated still.

I eagerly hope that the new Android Plugins API of Flutter 1.12 will be applied. Cheer up Ben.

SungKyung-Kim avatar Apr 28 '20 08:04 SungKyung-Kim

Yeah, you might want to add this tip in README while we wait for a fix for new users. If it's ok for you I can make a quick PR.

paolorotolo avatar Apr 29 '20 08:04 paolorotolo

If someone got it working please mention the solution I am still having this issue using the latest version of plugin and flutter version is 1.22.5 stable.

mateenkiani avatar Jan 08 '21 06:01 mateenkiani

There's a possible workaround in the first post. See if it still works.

paolorotolo avatar Jan 08 '21 11:01 paolorotolo

There's a possible workaround in the first post. See if it still works.

I have tried that but the application crashes on launch

mateenkiani avatar Jan 08 '21 15:01 mateenkiani