Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
paolorotolo opened this issue Mar 29, 2020 · 6 comments

Comments

@paolorotolo
Copy link
Contributor

paolorotolo commented Mar 29, 2020

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
Copy link
Owner

bkonyi commented Apr 13, 2020

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
Copy link

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
Copy link
Contributor Author

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
Copy link

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
Copy link
Contributor Author

paolorotolo commented Jan 8, 2021

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

@mateenkiani
Copy link

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

I have tried that but the application crashes on launch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants