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

Hive Open Encrypted box , HiveError: This should not happen. Please open an issue on GitHub. #854

Closed
dev-nesmin opened this issue Dec 15, 2021 · 1 comment
Labels
problem An unconfirmed bug.

Comments

@dev-nesmin
Copy link

Steps to Reproduce

  • Run the sample code
  • Run the sample code again with restart or terminate the app and re run
    Produces the error below
 Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub.
           #0      BinaryReaderImpl.readFrame (package:hive/src/binary/binary_reader_impl.dart:250:7)
           #1      FrameHelper.framesFromBytes (package:hive/src/binary/frame_helper.dart:21:26)
           #2      FrameIoHelper.framesFromFile (package:hive/src/io/frame_io_helper.dart:42:12)
           <asynchronous suspension>
           #3      StorageBackendVm.initialize (package:hive/src/backend/vm/storage_backend_vm.dart:86:11)
           <asynchronous suspension>
           #4      HiveImpl._openBox (package:hive/src/hive_impl.dart:116:9)
           <asynchronous suspension>
           #5      HiveImpl.openBox (package:hive/src/hive_impl.dart:145:12)

When i run the code sample below for the first time everything is fine , but when i run the code again with the same box name i get the error .Also when i change the box name and run again it works ,however when i run with the previous box name without terminating application i get the same error.I have also tried with terminating application and re run the app the error was same

Code sample

  await Hive.initFlutter();
  var key = Hive.generateSecureKey();
  var encryptedBox = await Hive.openBox('valut', encryptionCipher: HiveAesCipher(key));
  encryptedBox.put('secret', 'Hive is cool');
  print(encryptedBox.get('secret'));


Version

  • Platform: iOS ( emulator ), Haven't tried on others.
  • Flutter version: 2.8.0
  • Hive version: 2.0.3
  • Hive Flutter version: 1.1.0
@dev-nesmin dev-nesmin added the problem An unconfirmed bug. label Dec 15, 2021
@dev-nesmin
Copy link
Author

Duplication of #263
Sorry for re opening issue
And it seems when we try to change or add different box name the error occurs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem An unconfirmed bug.
Projects
None yet
Development

No branches or pull requests

1 participant