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

asynchronous suspension... HiveError: This should not happen. Please open an issue on GitHub. #803

Closed
sharukhrahman97 opened this issue Oct 7, 2021 · 3 comments
Labels
problem An unconfirmed bug.

Comments

@sharukhrahman97
Copy link

sharukhrahman97 commented Oct 7, 2021

Steps to Reproduce
Please tell me exactly how to reproduce the problem you are running into.

Code sample

 try {
    final FlutterSecureStorage secureStorage = const FlutterSecureStorage();
    var key = Hive.generateSecureKey();
    var encryptedBox = await Hive.openBox('tokenBox', encryptionCipher: HiveAesCipher(key));
    encryptedBox.put('token', token);
    await secureStorage.write(
      key: "${EnvironmentConfig.STORAGE_KEY}",
      value: json.encode(key),
    );
    encryptedBox.close();
  } catch (e) {
    throw (e.toString());
  }

Logs

E/flutter ( 5836): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub.
E/flutter ( 5836): #0      storeToken
E/flutter ( 5836): <asynchronous suspension>
E/flutter ( 5836): #1      _TestScaffoldState.build.<anonymous closure>
E/flutter ( 5836): <asynchronous suspension>
E/flutter ( 5836):
E/flutter ( 5836): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub.
E/flutter ( 5836): #0      BinaryReaderImpl.readFrame
E/flutter ( 5836): #1      FrameHelper.framesFromBytes
E/flutter ( 5836): #2      FrameIoHelper.framesFromFile
E/flutter ( 5836): <asynchronous suspension>
E/flutter ( 5836): #3      StorageBackendVm.initialize
E/flutter ( 5836): <asynchronous suspension>
E/flutter ( 5836): #4      HiveImpl._openBox
E/flutter ( 5836): <asynchronous suspension>
E/flutter ( 5836): #5      HiveImpl.openBox
E/flutter ( 5836): <asynchronous suspension>
E/flutter ( 5836): #6      storeToken
E/flutter ( 5836): <asynchronous suspension>
E/flutter ( 5836): #7      _TestScaffoldState.build.<anonymous closure>
E/flutter ( 5836): <asynchronous suspension>
E/flutter ( 5836):

Version

  • Platform: android,ios
  • Flutter version: 2.2.3
    hive: ^2.0.4
    hive_flutter: ^1.1.0
@sharukhrahman97 sharukhrahman97 added the problem An unconfirmed bug. label Oct 7, 2021
@sharukhrahman97
Copy link
Author

hey guys any fix done?? or is there any way to encrypt storage in flutter.????

@muccy
Copy link

muccy commented Oct 12, 2021

See #263
I'm trying a rise of these problems with my latest app release. I'm trying to catch the error by deleting the buggy box and recreating it (far from optimal)

@themisir
Copy link
Contributor

Closed with #914.

Please upgrade to hive v2.0.6.

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

3 participants