Closed brenomenosso closed 6 months ago
@felix-mittermeier help ?
This is a problem for me on too on iOS v16.
Crashalytics is reporting this consistently across many users. I've checked the entire codebase to ensure everything is being awaited properly;
I have tried two ways to initialise too;
storage.ready.then((success) =>AppStorage(storage)
and
await storage.ready AppStorage(storage);
Just replace the package inside your pub spec.yaml file with
localstorage:
git:
url: https://github.com/Ocell-io/flutter_localstorage.git
And the problem should be fixed :-)
Id suggest this is a system level bug then beyond any packages control 🤷♂️
Not sure what you mean? The issue is that in real life usage two operations at the same time try to read/write something to the local storage. If this happens, the system error is thrown. So in my fork of the package (as mentioned above) I ensured that it will never try to do two operations simultaneously but after each other.
Well you didn’t state it was a fork at all, you just said replace it with this - not very helpful.
I’ve already migrated to shared preferences.
Good luck.
Sent from Outlook for iOShttps://aka.ms/o0ukef
From: Felix Mittermeier @.> Sent: Friday, October 6, 2023 12:53:01 PM To: lesnitsky/flutter_localstorage @.> Cc: Andy Cresswell @.>; Comment @.> Subject: Re: [lesnitsky/flutter_localstorage] FileSystemException: An async operation is currently pending (Issue #102)
Not sure what you mean? The issue is that in real life usage two operations at the same time try to read/write something to the local storage. If this happens, the system error is thrown. So in my fork of the package (as mentioned above) I ensured that it will never try to do two operations simultaneously but after each other.
— Reply to this email directly, view it on GitHubhttps://github.com/lesnitsky/flutter_localstorage/issues/102#issuecomment-1750512359, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA5SIUNKDFTHEOLVD7QPOWLX57WJ3AVCNFSM6AAAAAA4VLGNNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJQGUYTEMZVHE. You are receiving this because you commented.Message ID: @.***>
I mean if it has the same package name, then it's always a fork. But sorry, just wanted to help. This issue was already explained multiple times in this issue: https://github.com/lesnitsky/flutter_localstorage/issues/56#issuecomment-800651187
I was tagged in a comment above, that's why I answered 😅
Thank you @felix-mittermeier, because error:
Error (Xcode): lib/services/localstorage_database.dart:1:8: Error: Error when reading '../../../.pub-cache/git/flutter_localstorage-be405ab1476da74ad4ca58458f93bbc7cddd2c02/lib/localstorage.dart': No such file or directory
pod install e pod update ?
@brenomenosso Please provide more details what you did, what happened and what you tried. Otherwise I don't think I can help you
I just added the git part as mentioned above to pubspec.... I tried pod install and pod update, because I'm running and testing on an iPhone
Normally you don't have to run the pod command newly after changing the package. Did you already try flutter clean
and flutter pub get
?
I try, cleaning
not working, import is correct ?
Yeah that's correct. Hmm this looks like you pub cache is invalid 🤔
Maybe you can try to delete the pubspec.lock file and then run flutter pub get
again.
ok, I will do this
not working. By any chance, do you have a print of your pubspec.lock of what it would look like?
v5 is synchronous now.
Exception has occurred. FileSystemException (FileSystemException: An async operation is currently pending, path = '/data/user/0/com.app.app')
Method Exception:
Future setKey(String key, dynamic data) async { await _checkIsReady();
}