Hi,
I found this issue where using desugaring to be able to use the Time classes in older Android versions ( below API 26, I believe) doesn't go very well with Paper/Kryo.
As a result, devices where desugaring is applied will serialize/deserialize using the CompatibleFieldSerializer and such instead. Which gets messy and causes issues in classes like ZonedDateTime where the Zone info is lost after serialization and deserialization.
I reported this issue on the Kryo repository and, understandably, it's not going to be fixed there. But maybe since Paper is more Android focused, it could be a good thing to fix?
As a band-aid solution in my project, I copied the whole TimeSerializers class from Kryo and removed the isClassAvailable() checks while calling Paper.addSerializer() myself to register every Serializer. It's been working pretty well and that would be my recommended approach. I can proceed with a PR if there's interest.
Hi, I found this issue where using desugaring to be able to use the Time classes in older Android versions ( below API 26, I believe) doesn't go very well with Paper/Kryo.
The problem is: after desugaring the time api will be located at package
j$.time
instead ofjava.time
. Then when Kryo registers the default serializers for those classes it fails to do so because there's a package name check .As a result, devices where desugaring is applied will serialize/deserialize using the
CompatibleFieldSerializer
and such instead. Which gets messy and causes issues in classes likeZonedDateTime
where the Zone info is lost after serialization and deserialization.I reported this issue on the Kryo repository and, understandably, it's not going to be fixed there. But maybe since Paper is more Android focused, it could be a good thing to fix?
As a band-aid solution in my project, I copied the whole
TimeSerializers
class from Kryo and removed theisClassAvailable()
checks while callingPaper.addSerializer()
myself to register every Serializer. It's been working pretty well and that would be my recommended approach. I can proceed with a PR if there's interest.