升级到 1.17.3 和 (1.17.3( 后local_auth我不能再使用生物识别插件了。插件需要FlutterFragmentActivity
,但是一旦我public class MainActivity extends FlutterActivity
更改为public class MainActivity extends FlutterFragmentActivity
应用程序就会编译并运行,但我会开始收到其他插件MissingPluginException
错误。
找到了解决方案,似乎尚未添加到local_auth文档中。确保在 MainActivity 类中从 FlutterActivity 更改为 FlutterFragmentActivity 后添加 configureFlutterEngine 覆盖方法,如下所示
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.embedding.android.FlutterFragmentActivity;
public class MainActivity extends FlutterFragmentActivity {
@Override
public void configureFlutterEngine(FlutterEngine flutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}