ERROR:flutter/lib/ui/ui_dart_state.cc(209) Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub.
E/flutter ( 7765): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub.
E/flutter ( 7765): #0 BinaryReaderImpl.readFrame (package:hive/src/binary/binary_reader_impl.dart:250:7)
E/flutter ( 7765): #1 FrameHelper.framesFromBytes (package:hive/src/binary/frame_helper.dart:21:26)
E/flutter ( 7765): #2 FrameIoHelper.framesFromFile (package:hive/src/io/frame_io_helper.dart:42:12)
E/flutter ( 7765):
I'm seeing this as well. Are you by chance using callbacks in different Isolates to access Hive?
@cspensky I'm having this problem too, and yes, I'm using isolates callbacks to access Hive, more specifically the FirebaseBackgroundMessageHandler
EDIT: For anyone with this issue, this comment help me to get a workaround https://github.com/hivedb/hive/issues/676#issuecomment-848809647, seems like Hive cannot be use to share data between Isolates. Also, special characters in box names looks like can corrupt the boxes
Isolate support has been pre-released for hive_ce!
Get the pre-releases here:
hive_ce hive_ce_flutter hive_ce_generator
Please try out IsolatedHive in your projects and report any issues you may have. I want to make sure all potential issues are ironed out before I make a real release.