无法将PluginRegistry转换为FlutterEngine
将flutter更新到1.12.13版后,我立即发现了此问题,无法解决。我按照firebase_messaging教程的指示发送了错误消息:“错误:不兼容的类型:PluginRegistry无法转换为FlutterEngine GeneratedPluginRegistrant.registerWith(注册表);”我的代码如下: package io.flutter.plugins; 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; import android.app.NotificationChannel; import android.app.NotificationManager; import android.os.Build; public class Application extends FlutterApplication implements PluginRegistrantCallback { @Override public void onCreate() { super.onCreate(); FlutterFirebaseMessagingService.setPluginRegistrant(this); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ NotificationChannel channel = new NotificationChannel("messages","Messages", NotificationManager.IMPORTANCE_LOW); NotificationManager manager = getSystemService(NotificationManager.class); manager.createNotificationChannel(channel); } …