title: InvalidClassCastException in .jar after using proguard
body: <p>I am using eclipse to develop an android app. When I press Run(the green triangle), the app works fine. But , I enabled proguard, and the app crashes. I am using the default proguard-android.txt which is present in sdk/tools/proguard. </p>
  
  <p>I have a jar called Software.jar , which has a few classes. One of them (Data) is a serializable class.<code>(with serialversionUID=112358L)</code>. This is (probably) the part that causes the error. </p>
  
  <p>This is the error log(i dont know why, but it is showing in yellow as a warning):</p>
  
  <blockquote>
    <p>07-22 15:29:46.429: W/System.err(2051): java.io.InvalidClassException:
    software.Data; Incompatible class (SUID): software.Data: static final
    long serialVersionUID =112358L; but expected software.Data: static
    final long serialVersionUID =-4551990835091843772L; 07-22
    15:29:46.433: W/System.err(2051):     at
    java.io.ObjectInputStream.verifyAndInit(ObjectInputStream.java:2380)
    07-22 15:29:46.433: W/System.err(2051):   at
    java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1662)
    07-22 15:29:46.437: W/System.err(2051):   at
    java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:683)
    07-22 15:29:46.437: W/System.err(2051):   at
    java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:1803)
    07-22 15:29:46.441: W/System.err(2051):   at
    java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:787)
    07-22 15:29:46.441: W/System.err(2051):   at
    java.io.ObjectInputStream.readObject(ObjectInputStream.java:2003)
    07-22 15:29:46.441: W/System.err(2051):   at
    java.io.ObjectInputStream.readObject(ObjectInputStream.java:1960)
    07-22 15:29:46.445: W/System.err(2051):   at
    java.util.ArrayList.readObject(ArrayList.java:657) 07-22 15:29:46.445:
    W/System.err(2051):   at java.lang.reflect.Method.invokeNative(Native
    Method) 07-22 15:29:46.449: W/System.err(2051):   at
    java.lang.reflect.Method.invoke(Method.java:511) 07-22 15:29:46.449:
    W/System.err(2051):   at
    java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1354)
    07-22 15:29:46.449: W/System.err(2051):   at
    java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1266)
    07-22 15:29:46.453: W/System.err(2051):   at
    java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:1855)
    07-22 15:29:46.453: W/System.err(2051):   at
    java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:787)
    07-22 15:29:46.457: W/System.err(2051):   at
    java.io.ObjectInputStream.readObject(ObjectInputStream.java:2003)
    07-22 15:29:46.457: W/System.err(2051):   at
    java.io.ObjectInputStream.readObject(ObjectInputStream.java:1960)
    07-22 15:29:46.457: W/System.err(2051):   at
    com.mainpackage.FullGenPhysics.a(Unknown Source) 07-22 15:29:46.457:
    W/System.err(2051):   at com.mainpackage.de.run(Unknown Source)</p>
  </blockquote>
  
  <p>and these are the red lines(tag error)</p>
  
  <blockquote>
    <p>07-22 15:29:46.465: E/AndroidRuntime(2051): FATAL EXCEPTION:
    Thread-161 07-22 15:29:46.465: E/AndroidRuntime(2051):
    java.lang.NullPointerException 07-22 15:29:46.465:
    E/AndroidRuntime(2051):   at software.Gen_Phy.a(Unknown Source) 07-22
    15:29:46.465: E/AndroidRuntime(2051):     at software.Gen_Phy.a(Unknown
    Source) 07-22 15:29:46.465: E/AndroidRuntime(2051):   at
    software.Gen_Phy.(Unknown Source) 07-22 15:29:46.465:
    E/AndroidRuntime(2051):   at com.mainpackage.FullGenPhysics.a(Unknown
    Source) 07-22 15:29:46.465: E/AndroidRuntime(2051):   at
    com.mainpackage.de.run(Unknown Source) 07-22 15:29:46.465:
    W/ActivityManager(333):   Force finishing activity
    com.mainpackage/.FullGenPhysics 07-22 15:29:46.525:
    E/SocketStream(112): readFully was waiting for 403440 bytes, got 49152
    07-22 15:29:46.525: E/SocketStream(112): readFully was waiting for
    354288 bytes, got 16384  07-22 15:29:46.529: E/SocketStream(112):
    readFully was waiting for 337904 bytes, got 1624  07-22 15:29:46.529:
    E/SocketStream(112): readFully was waiting for 336280 bytes, got 49152
    07-22 15:29:46.533: E/SocketStream(112): readFully was waiting for
    287128 bytes, got 16384  07-22 15:29:46.533: E/SocketStream(112):
    readFully was waiting for 270744 bytes, got 1624  07-22 15:29:46.537:
    E/SocketStream(112): readFully was waiting for 269120 bytes, got 49152
    07-22 15:29:46.537: E/SocketStream(112): readFully was waiting for
    219968 bytes, got 16384  07-22 15:29:46.537: E/SocketStream(112):
    readFully was waiting for 203584 bytes, got 1624  07-22 15:29:46.541:
    E/SocketStream(112): readFully was waiting for 201960 bytes, got 49152
    07-22 15:29:46.541: E/SocketStream(112): readFully was waiting for
    152808 bytes, got 16384  07-22 15:29:46.541: E/SocketStream(112):
    readFully was waiting for 136424 bytes, got 1624  07-22 15:29:46.545:
    E/SocketStream(112): readFully was waiting for 134800 bytes, got 49152
    07-22 15:29:46.545: E/SocketStream(112): readFully was waiting for
    85648 bytes, got 16384  07-22 15:29:46.549: E/SocketStream(112):
    readFully was waiting for 69264 bytes, got 1624  07-22 15:29:46.549:
    E/SocketStream(112): readFully was waiting for 67640 bytes, got 49152 
    07-22 15:29:46.549: E/SocketStream(112): readFully was waiting for
    18488 bytes, got 16384</p>
  </blockquote>
  
  <p>The funny thing is, that I have a system.out in one of the classes of software.jar. That is getting printed. </p>
  
  <p>I have tried adding <code>-libraryjars C:\Users\Harsh\git\marks++\Marks++\Software.jar</code> as well as</p>
  
  <pre><code>-keep  class Software.**
  </code></pre>
  
  <p>to the already mentioned .txt file</p>
  
  <p>Where am I going wrong ?</p>
  
  <p><strong>EDIT</strong></p>
  
  <blockquote>
  <pre><code>07-22 16:10:54.957: W/System.err(2233): java.lang.ClassNotFoundException: software.Data
  07-22 16:10:54.961: W/System.err(2233):   at java.lang.Class.classForName(Native Method)
  07-22 16:10:54.961: W/System.err(2233):   at java.lang.Class.forName(Class.java:217)
  07-22 16:10:54.965: W/System.err(2233):   at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:2301)
  07-22 16:10:54.965: W/System.err(2233):   at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1660)
  07-22 16:10:54.965: W/System.err(2233):   at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:683)
  07-22 16:10:54.969: W/System.err(2233):   at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:1803)
  07-22 16:10:54.969: W/System.err(2233):   at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:787)
  07-22 16:10:54.973: W/System.err(2233):   at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2003)
  07-22 16:10:54.973: W/System.err(2233):   at java.io.ObjectInputStream.readObject(ObjectInputStream.java:1960)
  07-22 16:10:54.973: W/System.err(2233):   at java.util.ArrayList.readObject(ArrayList.java:657)
  07-22 16:10:54.973: W/System.err(2233):   at java.lang.reflect.Method.invokeNative(Native Method)
  07-22 16:10:54.977: W/System.err(2233):   at java.lang.reflect.Method.invoke(Method.java:511)
  07-22 16:10:54.977: W/System.err(2233):   at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1354)
  07-22 16:10:54.977: W/System.err(2233):   at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1266)
  07-22 16:10:54.977: W/System.err(2233):   at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:1855)
  07-22 16:10:54.977: W/System.err(2233):   at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:787)
  07-22 16:10:54.977: W/System.err(2233):   at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2003)
  07-22 16:10:54.977: W/System.err(2233):   at java.io.ObjectInputStream.readObject(ObjectInputStream.java:1960)
  07-22 16:10:54.977: W/System.err(2233):   at com.mainpackage.FullGenPhysics.a(Unknown Source)
  07-22 16:10:54.977: W/System.err(2233):   at com.mainpackage.de.run(Unknown Source)
  07-22 16:10:54.981: W/System.err(2233): Caused by: java.lang.NoClassDefFoundError: software/Data
  07-22 16:10:54.981: W/System.err(2233):   ... 20 more
  07-22 16:10:54.981: W/System.err(2233): Caused by: java.lang.ClassNotFoundException: software.Data
  07-22 16:10:54.981: W/System.err(2233):   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
  07-22 16:10:54.981: W/System.err(2233):   at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  07-22 16:10:54.981: W/System.err(2233):   at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  07-22 16:10:54.985: W/System.err(2233):   ... 20 more
  </code></pre>
  </blockquote>