Android Proger Nightmare

When I create a new APK for my application, the old serial saved data is no longer loaded, I get this exception:

java.io.InvalidClassException: org.myapp.bb; Incompatible class (SUID): org.myapp.bb: static final long serialVersionUID =1L; but expected org.myapp.bb: static final long serialVersionUID =0L; 

I have this in proguard.cfg:

 -keepnames class * implements java.io.Serializable -keepclassmembers class * implements java.io.Serializable { static final long serialVersionUID; private static final java.io.ObjectStreamField[] serialPersistentFields; !static !transient <fields>; !private <fields>; !private <methods>; private void writeObject(java.io.ObjectOutputStream); private void readObject(java.io.ObjectInputStream); java.lang.Object writeReplace(); java.lang.Object readResolve(); } 

My serialVersionUID does not change in code. When I debug everything works, but when I test my new apk it will not load the old data.

ANY ideas?

+4
source share

Source: https://habr.com/ru/post/1442515/


All Articles