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

embedding v2 issue #3

Closed
andreagr opened this issue Aug 3, 2020 · 1 comment
Closed

embedding v2 issue #3

andreagr opened this issue Aug 3, 2020 · 1 comment
Assignees

Comments

@andreagr
Copy link

andreagr commented Aug 3, 2020

I have an issue while trying to upgrade my project to the embiddingv2 required.
I followed these instructions: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects updating my MainActivity.kt, and manifest, but when I try to run i get this:

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

My Application.kt is:


import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService

class Application : FlutterApplication(), PluginRegistry.PluginRegistrantCallback {
    override fun onCreate() {
        super.onCreate()

        FlutterFirebaseMessagingService.setPluginRegistrant(this);
    }

    override fun registerWith(registry: PluginRegistry?) {
        GeneratedPluginRegistrant.registerWith(registry);
    }
}```
@aktug
Copy link
Contributor

aktug commented Aug 4, 2020

Hi @andreagr
replace with :

class MainApplication : FlutterApplication(), PluginRegistrantCallback {

    override fun onCreate() {
        super.onCreate()
        FlutterFirebaseMessagingService.setPluginRegistrant(this);
    }

    override fun registerWith(registry: PluginRegistry?) {
        registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin");
    }

}

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

2 participants