'Unhandled Exception: HiveError: Cannot read, unknown typeId: 34. Did you forget to register an adapter ? ( Flutter )

App is not restarting after writes made using hive in disk. It's throwing the above error and app is not opening.



Solution 1:[1]

Solution is place registerAdapter above Hive.openBox

await Hive.initFlutter();
Hive.registerAdapter(TodoAdapter());
await Hive.openBox('todos');

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bauroziq