macos 中的 HiveDB 构建抖动

问题描述

我有一个使用 hiveDB 的 Flutter 应用程序,它在 iOS 设备和模拟器上运行良好,但是在 macOS 上构建它时,会弹出以下错误

Unhandled Exception: HiveError: Cannot read,unkNown typeId: 32. Did you forget to register an adapter?

这是我的主要方法

main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Hive.initFlutter();
  Hive.registeradapter(PriceAdapter());
  Hive.registeradapter(AmountAdapter());
  Hive.registeradapter(CustomerAdapter());
  Hive.registeradapter(ProductAdapter());
  Hive.registeradapter(FactorAdapter());
  await Hive.openBox<Product>(TableName.PRODUCT);
  await Hive.openBox<Factor>(TableName.FACTOR);
  runApp(MyApp());
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)