1

I have uploaded a new release of my app to play store. When my clients tries to update to the newer version they get the following

com.rio.g.l; Incompatible class (SUID): com.rio.g.l: static final long serialVersionUID =5129006085660760312L; but expected com.rio.g.l: static final long serialVersionUID =0L;

When I install the same apk file via adb, it is working fine. Why does this error occur? How can I solve this error in the play store?

Sumurai8
  • 20,333
  • 11
  • 66
  • 100
dev
  • 461
  • 3
  • 6
  • 18
  • Is the class `com.rio.g.l` your own class or is it from a library that you are using? – Pat Aug 06 '14 at 11:32
  • its my own class. but because of progaurd it is showing like this. – dev Aug 06 '14 at 11:34
  • This problem occurs when you have serialized an object earlier when your class had `serialVersionUID=0L` and after publishing the update, the same class has `serialVersionUID=5129006085660760312L`. This value may be computed by your JVM, if not explicitly provided in the code. That is why it is a good practice to initialize `serialVersionUID` field manually in your serializable classes. Read more about it here: http://stackoverflow.com/questions/285793/what-is-a-serialversionuid-and-why-should-i-use-it – Pat Aug 06 '14 at 11:36
  • 2
    For ProGuard issue, take a look here: http://stackoverflow.com/questions/16210831/serialization-deserialization-proguard – Pat Aug 06 '14 at 11:38
  • Thanks for explaination, but Right now my new apk already uploaded on store. so, can how can I prevent my user from getting this error? – dev Aug 06 '14 at 11:39
  • Push another update and roll `serialVersionUID` back to `0L`. – stevecross Aug 06 '14 at 11:54
  • I tried it local but it's not working. I have replace serialVersionUID with 0L. – dev Aug 06 '14 at 12:08
  • You will have to change your class so that it has `serialVersionUID=0L` and re-release your app. Unless proguard has renamed different class before to `com.rio.g.l` and different class now. You should add classes that you serialize -> deserialize to be skipped by proguard. – diginoise Aug 06 '14 at 12:16
  • okay let me try to change class name – dev Aug 06 '14 at 12:20
  • @dev Don't use proguard, build the app and see whether it's still not working. It is likely that proguard previously renamed some other class to `com.rio.g.l` in which case the serialisation will fail. If it works without proguard, you have to add the classes that you serialize ---> deserialize to the list of skipped classes by proguard. – diginoise Aug 12 '14 at 12:12

0 Answers0