Open tomasweigenast opened 3 years ago
You've probably used same typeId for multiple types.
You've probably used same typeId for multiple types.
Same problem.
You've probably used same typeId for multiple types.
Same problem.
I hope this information helps someone. I reinstall the app - everything worked. I guess it was corrupted data.
btw can i erase all the hive data from device with internal hive library methods?
btw can i erase all the hive data from device with internal hive library methods?
Yes, there's a method called deleteFromDisk()
.
same problem
same problem
Try to define adapter type when register it.
Hive.registerAdapter<TypeOfAdapterHere>(adapter))
same problem
Try to define adapter type when register it.
Hive.registerAdapter<TypeOfAdapterHere>(adapter))
yes, that's it.
but is there any way to register list of TypeAdapter
in place, like :
adapters.forEach((adapter) => Hive.registerAdapter(adapter));
Map<dynamic, TypeAdapter> adapters = { FirstType: FirstTypeAdapter, SecondType: SecondTypeAdapter } adapters.forEach((k,v) => Hive.registerAdapter<k>(v));
will get :
The name 'k' isn't a type so it can't be used as a type argument.
Map<dynamic, TypeAdapter> adapters = { FirstType: FirstTypeAdapter, SecondType: SecondTypeAdapter } adapters.forEach((k,v) => Hive.registerAdapter<k>(v));
will get :
The name 'k' isn't a type so it can't be used as a type argument.
Yes, it was a stupid suggestion) Sorry.
I got this error when I try to save an
Account
to a box:It seems like Hive is getting the wrong adapter.
Account
andOrder
are classes that have their corresponding adapter. They are registered in the following order:OrderAdapter(), AccountAdapter()
. If I invert the order, the exception is the same when I try to save an Order type.I have a wrapper around Hive.registerAdapter to register them like:
And then:
Adapters are registered before
Hive.init()