I have an sbt Scala project:
Subproject lib contains some classes with @SerialVersionUID, such as in:
@SerialVersionUID(10L) class MyStuff extends Serializable { ... }
Project app is an Android application (uses android-sdk-plugin), it has lib as its dependency
I have a file, into which I serialized a number of MyStaff objects using local JVM on my dev machine (1.7.0_75)
When I try to deserialize this file using the same JVM, all works fine
When I try to deserialize this file on Android, using exactly the same code, I get the following error message:
java.io.InvalidClassException: com.example.MyStuff; Incompatible class (SUID): com.example.MyStuff: static final long serialVersionUID =10L; but expected com.example.MyStuff: static final long serialVersionUID =-7513795898815927590L;
So, looks like my serialVersionUID was lost while in transition to Android. Any ideas why? Some proguard settings? Something funky with Dalvik? Me being somehow stupid (most likely :) )