I don't know what is going on. I made a minimal reproducible sample modifying the counter sample: counter.zip
I/flutter (24325): HiveError: There is already a TypeAdapter for typeId 35.
It loads fine, then refreshes (probably because put has occurred) and things get weird. Why is that happening?
Your sample works fine for me. What device are you testing on? Maybe try to execute flutter clean.
Well, that's certainly weird. I tried flutter clean without success.
Currently Android Emulator API 29. Just make sure to wait a few seconds (like 3~5 seconds) after opening it.
Hey, could you reproduce it? I'm locked because of it.
I think I know the problem. When you do a hot reload, your _openBox() is called a second time and fails because the TypeAdapter has already been registered.
This should work:
```dart
var initialized = false;
Future _openBox() async {
if (!initialized) {
initialized = true;
if (!isBrowser) {
var dir = await getApplicationDocumentsDirectory();
Hive.init(dir.path);
}
Hive.registerAdapter(ColorAdapter(), 35);
}
return await Hive.openBox('myBox');
}
Nope. When I press run it gives this.

When I hot-restart it works. Really weird.
This works fine for me...
I think I know the issue!
I think the Hive database got somehow corrupted. I needed to reinstall my app, now it is working fine. Thanks!
Most helpful comment
I think I know the issue!
I think the Hive database got somehow corrupted. I needed to reinstall my app, now it is working fine. Thanks!