I am trying to implement firebase_messaging in my flutter application. On Android Integration when i write native Application level code i get errors.
import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
class Application: FlutterApplication(), PluginRegistrantCallback {
override fun onCreate() {
super.onCreate()
FlutterFirebaseMessagingService.setPluginRegistrant(this)
}
override fun registerWith(registry: PluginRegistry?) {
GeneratedPluginRegistrant.registerWith(registry)
}
}
Unresolved Reference: FlutterFirebaseMessagingService
TypeMismatch: Required FlutterEngine. Found PluginRegistry?
I have successfully added Google-services.json under my app folder also added the required dependencies in the project level gradle and app level gradle currently i am using
implementation 'com.google.firebase:firebase-messaging:20.1.3'
Version.
Flutter Details: Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.1 19B88, locale en-US) Firebase_messaging version is ^6.0.12
I have even tried to downgrade the version of firebase-Messaging but still found this problem.