pilgr / Paper

Paper is a fast NoSQL-like storage for Java/Kotlin objects on Android with automatic schema migration support.
Apache License 2.0
2.35k stars 234 forks source link

Couldn't read/deserialize file /data/~/files/io.paperdb/~.pt for table ~ #202

Open zuhriddinjon opened 2 years ago

zuhriddinjon commented 2 years ago

minifyEnabled true shrinkResources true

hamza-mughal5593 commented 1 year ago

@zuhriddinjon any solutions?

filipebrandao commented 1 year ago

@zuhriddinjon @hamza-mughal5593 since you have minifyEnabled true, that can be caused because code obfuscation changed the field names. I've experienced the same field getting different obfuscated names in subsequent builds.

If you notice how the data is stored in the table file, you'll see that the field names are written there. Thus an unexpected change in the field name will make it impossible to deserialize data.

Besides the rule indicated here https://github.com/pilgr/Paper#proguard-config , I would recommend also considering keeping enums unless your data models don't use them : -keep enum your.app.data.model.** { *; }

Update: I've just submitted this PR #204 with all my suggested proguard rules.

zuhriddinjon commented 1 year ago

I have found a solution. It was the old version of Paper that I used. Once updated it has been solved. Thanks for your attention