Closed Patrick386 closed 1 year ago
I got the same error, after upgrading Flutter to the 3.10.2 version.
This is stack trace from crashanalytics :
Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: FileSystemException: Creation failed, path = 'algolia' (OS Error: Read-only file system, errno = 30) at ._rootRunUnary(dart:async) at BackendManager.open(backend_manager.dart:34) at HiveImpl._openBox(hive_impl.dart:101) at HiveImpl.openBox(hive_impl.dart:142) at UserTokenStorage.read(user_token_storage.dart:101)
This is caused by an issue in how hive
is used in https://github.com/algolia/algoliasearch-helper-flutter/blob/main/insights_dart/lib/src/user_token_storage.dart
It seems like that when you create an HitsSearcher
you are also forced to instantiate Insight
even if you don't actually use it.
The fix is to add a temporary writable directory before opening the box. I'll PR that so that later people can point to that version for the fix.
Similar to this issue: https://github.com/hivedb/hive/issues/40
Hi @Patrick386, @deogw ,
Thank you for reporting this issue.
I'm actively working to find a solution and fix this as soon as possible.
That's great.
It seems like the solution is simply to do this:
Future<Box> get _box async {
final tmpDir = await getTemporaryDirectory();
return Hive.openBox(_boxName, path: '${tmpDir.path}/$_boxPath');
}
instead of this:
I've forked the repo and I'm testing this right now.
I've tested it locally and the error is not triggered anymore, as a temporary workaround until the maintainer ship this code you can point at my commit:
pubspec.yml
dependency_overrides:
algolia_insights:
git:
url: https://github.com/nerder/algoliasearch-helper-flutter/
ref: 1f90cc5095527c43ac8820415dfe24b2c937d37f
path: insights_dart
Same error
Same error, is there a timeline as to when the fix will be merged to main and published?
When I run the app on the iOS emulator(iPhone 14), I encounter the following error. Do you know how to resolve it? Just to note, there are no issues when running it on the web.
algolia_helper_flutter: ^0.3.2
Flutter doctor