Skip to content

10001 Cannot open store after exiting app by going back #442

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

Closed
greenrobot-team opened this issue Jul 4, 2022 · 5 comments
Closed

10001 Cannot open store after exiting app by going back #442

greenrobot-team opened this issue Jul 4, 2022 · 5 comments
Labels
more info required Needs more info to become actionable. Auto-closed if no response.

Comments

@greenrobot-team
Copy link
Member

When exiting a Flutter app using the back navigation button, then re-launching it the following exception appears:

10001 Cannot open store: another store is still open using the same path

Basic info (please complete the following information):

  • ObjectBox version: 1.5.0
  • Flutter/Dart SDK: 3.0.3
  • Reproducibility: always
  • OS: Android

Moved out of similar, but unrelated (Flutter hot restart) #387

@greenrobot-team greenrobot-team added bug Something isn't working more info required Needs more info to become actionable. Auto-closed if no response. labels Jul 4, 2022
@greenrobot-team
Copy link
Member Author

@BLB-EN438 @animedev1 I can't reproduce this with our example (e.g. launch, press back, then launch the app from the launcher shortcut again).

Is ObjectBox in your project maybe set up differently from the example?

@greenrobot-team greenrobot-team added more info required Needs more info to become actionable. Auto-closed if no response. and removed more info required Needs more info to become actionable. Auto-closed if no response. labels Jul 4, 2022
@github-actions
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue.

@greenrobot-team greenrobot-team removed the bug Something isn't working label Jul 26, 2022
@techouse
Copy link

techouse commented Mar 11, 2023

I have had the same error when opening a deep link on Android.

Looks like it's related to flutter/flutter#91649

The fix is to change the Android launch mode from singleTop to singleInstance

<activity
  android:launchMode="singleInstance"
  // ...
>

and to ensure that only ever one instance of an ObjectBox Store is open at the same time using Store.isOpen(pathToYourStore).

@greenrobot-team
Copy link
Member Author

@techouse Thanks for the details! So this is another workaround instead of using an is open check and doing attach vs. open, see #436.

Then #436 is not an edge case after all and a Store being opened multiple times can actually happen more frequently than I thought. We maybe should add guidance in the docs about this then or maybe adapt our API if possible.

@user97116

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info required Needs more info to become actionable. Auto-closed if no response.
Projects
None yet
Development

No branches or pull requests

3 participants