title: Using joda-time-android with proguard
body: <p>I'm trying to use <a href="https://github.com/dlew/joda-time-android" rel="nofollow noreferrer">joda-time-android</a> in my app while also using proguard. The problem is that when I try to get a LocalDate as from an Intent like this:</p>
  
  <pre><code>LocalDate date = (LocalDate) data.getSerializableExtra("dueDate");
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Process: org.mpardalos.homeworkmanager, PID: 7509
      java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2, result=-1, data=Intent { (has extras) }} to activity {org.mpardalos.homeworkmanager/org.mpardalos.homeworkmanager.TaskList}: java.lang.NullPointerException
              at android.app.ActivityThread.deliverResults(ActivityThread.java:3389)
              at android.app.ActivityThread.handleSendResult(ActivityThread.java:3432)
              at android.app.ActivityThread.access$1300(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1253)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:136)
              at android.app.ActivityThread.main(ActivityThread.java:5146)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:515)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
              at dalvik.system.NativeStart.main(Native Method)
       Caused by: java.lang.NullPointerException
              at org.joda.time.LocalDate.isSupported(LocalDate.java:577)
              at org.joda.time.format.DateTimeFormatterBuilder$PaddedNumber.printTo(DateTimeFormatterBuilder.java:1434)
              at org.joda.time.format.DateTimeFormatterBuilder$Composite.printTo(DateTimeFormatterBuilder.java:2446)
              at org.joda.time.format.DateTimeFormatter.print(DateTimeFormatter.java:663)
              at org.joda.time.base.AbstractPartial.toString(AbstractPartial.java:412)
              at org.mpardalos.homeworkmanager.TaskList.onActivityResult(TaskList.java:91)
              at android.app.Activity.dispatchActivityResult(Activity.java:5423)
              at android.app.ActivityThread.deliverResults(ActivityThread.java:3385)
              at android.app.ActivityThread.handleSendResult(ActivityThread.java:3432)
              at android.app.ActivityThread.access$1300(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1253)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:136)
              at android.app.ActivityThread.main(ActivityThread.java:5146)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:515)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
              at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>and the debugger says this about the variable:</p>
  
  <pre><code>Method threw 'java.lang.NullPointerException' exception.
  </code></pre>
  
  <p>However, the problem disappears as soon as I remove <code>minifyEnabled</code> from the gradle build file.</p>
  
  <p>The only temporary solution I've found is to disable proguard as the app is relatively small (2 MB without proguard - 0.9 MB with it) but I do plan to add a lot more functionality so I'm going to need 
  it in the future.</p>
  
  <p>Could anyone point me to a solution for the problem? </p>
  
  <p>TL;DR joda-time-android doesn't work when proguard is enabled</p>