hive icon indicating copy to clipboard operation
hive copied to clipboard

ERROR:flutter/lib/ui/ui_dart_state.cc(209) Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub.

Open PavelSmertin opened this issue 4 years ago • 3 comments

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): E/flutter ( 7765): #3 StorageBackendVm.initialize (package:hive/src/backend/vm/storage_backend_vm.dart:86:11) E/flutter ( 7765): E/flutter ( 7765): #4 HiveImpl._openBox (package:hive/src/hive_impl.dart:116:9) E/flutter ( 7765): E/flutter ( 7765): #5 HiveImpl.openBox (package:hive/src/hive_impl.dart:145:12) E/flutter ( 7765): E/flutter ( 7765): #6 main (package:miracle/main.dart:146:3) E/flutter ( 7765): E/flutter ( 7765):

PavelSmertin avatar Aug 13 '21 07:08 PavelSmertin

I'm seeing this as well. Are you by chance using callbacks in different Isolates to access Hive?

cspensky avatar Sep 03 '21 23:09 cspensky

@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

ronpetit avatar Sep 07 '21 17:09 ronpetit

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.

Rexios80 avatar Mar 18 '25 22:03 Rexios80