Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub. #379

Closed
amirmhmdi opened this issue Jul 20, 2020 · 2 comments
Assignees
Labels
needs-author-feedback Needs feedback from author problem An unconfirmed bug.

Comments

@amirmhmdi
Copy link

amirmhmdi commented Jul 20, 2020

Steps to Reproduce
when app open i want to open a box and inital to static var but it give me this err:

[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub.
E/flutter (16988): #0 BinaryReaderImpl.readFrame
package:hive/…/binary/binary_reader_impl.dart:249
E/flutter (16988): #1 FrameHelper.framesFromBytes
package:hive/…/binary/frame_helper.dart:17
E/flutter (16988): #2 FrameIoHelper.framesFromFile
package:hive/…/io/frame_io_helper.dart:41
E/flutter (16988):
E/flutter (16988): #3 StorageBackendVm.initialize
package:hive/…/vm/storage_backend_vm.dart:82
E/flutter (16988):
E/flutter (16988): #4 BoxBaseImpl.initialize
package:hive/…/box/box_base_impl.dart:90
E/flutter (16988): #5 HiveImpl._openBox
package:hive/src/hive_impl.dart:90
E/flutter (16988):
E/flutter (16988): #6 HiveImpl.openBox
package:hive/src/hive_impl.dart:111
E/flutter (16988): #7 dBInitial
package:flutter_app_instagram/main.dart:87
E/flutter (16988):
E/flutter (16988): #8 main
package:flutter_app_instagram/main.dart:61
E/flutter (16988): #9 _runMainZoned.. (dart:ui/hooks.dart:241:25)
E/flutter (16988): #10 _rootRun (dart:async/zone.dart:1184:13)
E/flutter (16988): #11 _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (16988): #12 _runZoned (dart:async/zone.dart:1619:10)
E/flutter (16988): #13 runZonedGuarded (dart:async/zone.dart:1608:12)
E/flutter (16988): #14 _runMainZoned. (dart:ui/hooks.dart:233:5)
E/flutter (16988): #15 _startIsolate. (dart:isolate-patch/isolate_patch.dart:301:19)
E/flutter (16988): #16 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Code sample

dBInitial() async {
  var dir = await getApplicationDocumentsDirectory();
  Hive.init(dir.path);
  if (Hive.isBoxOpen(dbName) == false) {
    HiveBox.box = await Hive.openBox(dbName);
  }
}

Version

  • Platform: Android
  • Flutter version: [1.17.5]
  • Hive version: [1.4.1+1]
@amirmhmdi amirmhmdi added the problem An unconfirmed bug. label Jul 20, 2020
@themisir
Copy link
Contributor

themisir commented Jul 23, 2020

Could you try clearing app storage and re-running the code? You can also try removing and re-installing the app again. Stored data might be crashed or invalid.

@themisir themisir added the needs-author-feedback Needs feedback from author label Jul 23, 2020
@themisir
Copy link
Contributor

Duplicate of #263

@themisir themisir marked this as a duplicate of #263 Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-author-feedback Needs feedback from author problem An unconfirmed bug.
Projects
None yet
Development

No branches or pull requests

3 participants