bkonyi / FlutterGeofencing

Rough work for Flutter geofencing plugin
BSD 3-Clause "New" or "Revised" License
337 stars 219 forks source link

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

Open paolorotolo opened 4 years ago

paolorotolo commented 4 years ago

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
bkonyi commented 4 years ago

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.

SungKyung-Kim commented 4 years ago

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.

paolorotolo commented 4 years ago

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.

mateenkiani commented 3 years ago

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.

paolorotolo commented 3 years ago

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

mateenkiani commented 3 years ago

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

I have tried that but the application crashes on launch