Comments (4)
Thanks for the answer, I implemented it like in your "Todo App" example and got to know path_provider as well. The problem was still there, but "chmod 777" probably solved it.
from hive.
I don't think this is a valid path. Since the asset files are read only, Hive cannot create a box there.
Please use the path_provider
package to get a valid path. Take a look at the example apps in the Hive repository.
from hive.
Solved with: getApplicationDocumentsDirectory()
from hive.
@leisim I'm getting this same error after running the project again for some time.
FileSystemException: Cannot create file, path = /Users/thinkdigital/Library/Developer/CoreSimulator/Devices/F3A5BA32-2FC7-491B-9862-A42B54C487A5/data/Containers/Data/Application/7B94FC78-4946-497E-9953-E25E7B4FCE1F/Documents/FullPackage
Exception:
message: Cannot create file
path: /users/thinkdigital/library/developer/coresimulator/devices/f3a5ba32-2fc7-491b-9862-
a42b54c487a5/data/containers/data/application/7b94fc78-4946-497e-9953-
e25e7b4fce1f/documents/fullpackage.hive
OS Error: No such file or directory, errno = 2
Sorry for the bad formatting. I tried deleting the app from the simulator, I also tried ensuring that the path existed by CD'ing there from the terminal and it does.
The code in question is
Future initialize() async {
var applicationsDocumentDirectory =
await getApplicationDocumentsDirectory();
var hiveBoxPath =
'${applicationsDocumentDirectory.path}/${ValueType.toString()}';
box = await Hive.openBox(hiveBoxPath);
}
Another weird thing is that hiveBoxPath evaluates to
/Users/thinkdigital/Library/Developer/CoreSimulator/Devices/F3A5BA32-2FC7-491B-9862-A42B54C487A5/data/Containers/Data/Application/7B94FC78-4946-497E-9953-E25E7B4FCE1F/Documents/FullPackage
, which is the same as the path in the error message, but with the proper capitals and it's missing the '.hive' extension.
from hive.
Related Issues (20)
- Lost Data After Update From Store HOT 6
- Widget test returns HiveError: The box "orders" is already open and of type Box<Order>.
- TypeError: null: type 'minified:E5' is not a subtype of type 'bool'
- Safe to add "extends HiveObject" later?
- Is it possible to add a custom class defaultValue to a HiveField?
- HiveError thrown twice
- Hive + MediaItem Class? Is it possible? HOT 1
- Flutter Windows app - .lock and .hive file location HOT 1
- [CollectionBox] compact or CompactionStrategy
- Question: Read .hive files without using HiveDB functions
- Wrong Pub dev documentation
- Future of Hive/Isar HOT 2
- Github link missing in package listing on pub.dev
- Support for record types
- [Web] The "values" returned in "Box" are empty
- Fail to initialize Hive 4.0.0 for Flutter Web? HOT 1
- [Hive v4] Type mistmatch when get List<T> items.
- Unable to install on new flutter project HOT 1
- Support for enhanced enums
- Updating nested map keys
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hive.