title: Android Volley always fails with Proguard
body: <p>The goal is to deploy an application with <code>obfuscation</code> and <code>minification</code> applied. Usual builds without <code>minification</code> work fine. But when <code>minifyEnabled</code> is switched to true, everything compiles too, but all <code>Volley</code> requests fail with error callback (<code>onErrorResponse</code>) regardless on successful result.</p>
  
  <p>Minification config in <code>build.gradle</code>:</p>
  
  <pre><code>buildTypes {
      release {
          minifyEnabled true
          shrinkResources true
          proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
      }
      debug {
          debuggable true
      }
  }
  </code></pre>
  
  <p>proguard-rules.pro:</p>
  
  <pre><code>##---------------Begin: proguard configuration for Gson  ----------
  # Gson uses generic type information stored in a class file when working with fields. Proguard
  # removes such information by default, so configure it to keep all of it.
  -keepattributes Signature
  
  # For using GSON @Expose annotation
  -keepattributes *Annotation*
  
  # Gson specific classes
  -keep class sun.misc.Unsafe { *; }
  #-keep class com.google.gson.stream.** { *; }
  
  # Application classes that will be serialized/deserialized over Gson
  -keep class com.google.gson.examples.android.model.** { *; }
  
  # Prevent proguard from stripping interface information from TypeAdapterFactory,
  # JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
  -keep class * implements com.google.gson.TypeAdapterFactory
  -keep class * implements com.google.gson.JsonSerializer
  -keep class * implements com.google.gson.JsonDeserializer
  
  ##---------------End: proguard configuration for Gson  ----------
  
  
  
  ##---------------Begin: proguard configuration for Spongy Castle  ----------
  
  -keep class org.spongycastle.crypto.* {*;}
  -keep class org.spongycastle.crypto.digests.* {*;}
  -keep class org.spongycastle.crypto.encodings.* {*;}
  -keep class org.spongycastle.crypto.engines.* {*;}
  -keep class org.spongycastle.crypto.macs.* {*;}
  -keep class org.spongycastle.crypto.modes.* {*;}
  -keep class org.spongycastle.crypto.paddings.* {*;}
  -keep class org.spongycastle.crypto.params.* {*;}
  -keep class org.spongycastle.crypto.prng.* {*;}
  -keep class org.spongycastle.crypto.signers.* {*;}
  
  -keep class org.spongycastle.jcajce.provider.digest.** {*;}
  -keep class org.spongycastle.jcajce.provider.keystore.** {*;}
  -keep class org.spongycastle.jcajce.provider.symmetric.** {*;}
  -keep class org.spongycastle.jcajce.spec.* {*;}
  -keep class org.spongycastle.jce.** {*;}
  
  -dontwarn javax.naming.**
  
  ##---------------End: proguard configuration for Spongy Castle  ----------
  
  
  
  # Configuration for Guava 18.0
  #
  # disagrees with instructions provided by Guava project: https://code.google.com/p/guava-libraries/wiki/UsingProGuardWithGuava
  
  -keep class com.google.common.io.Resources {
      public static &lt;methods&gt;;
  }
  -keep class com.google.common.collect.Lists {
      public static ** reverse(**);
  }
  -keep class com.google.common.base.Charsets {
      public static &lt;fields&gt;;
  }
  
  -keep class com.google.common.base.Joiner {
      public static com.google.common.base.Joiner on(java.lang.String);
      public ** join(...);
  }
  
  -keep class com.google.common.collect.MapMakerInternalMap$ReferenceEntry
  -keep class com.google.common.cache.LocalCache$ReferenceEntry
  
  # http://stackoverflow.com/questions/9120338/proguard-configuration-for-guava-with-obfuscation-and-optimization
  -dontwarn javax.annotation.**
  -dontwarn javax.inject.**
  -dontwarn sun.misc.Unsafe
  
  # Guava 19.0
  -dontwarn java.lang.ClassValue
  -dontwarn com.google.j2objc.annotations.Weak
  -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  
  
  
  # Security classes for keystore support
  -dontwarn java.awt.**, javax.security.**, java.beans.**
  
  
  
  # Volley
  -dontwarn com.android.volley.**
  -dontwarn com.android.volley.error.**
  -keep class com.android.volley.** { *; }
  -keep class com.android.volley.toolbox.** { *; }
  -keep class com.android.volley.Response$* { *; }
  -keep class com.android.volley.Request$* { *; }
  -keep class com.android.volley.RequestQueue$* { *; }
  -keep class com.android.volley.toolbox.HurlStack$* { *; }
  -keep class com.android.volley.toolbox.ImageLoader$* { *; }
  -keep interface com.android.volley.** { *; }
  -keep class org.apache.commons.logging.*
  </code></pre>
  
  <p>All used dependencies:</p>
  
  <pre><code>compile 'com.android.support:appcompat-v7:23.4.0'
  compile 'com.android.support:design:23.4.0' 
  
  compile 'com.google.code.gson:gson:2.7'
  compile 'com.android.volley:volley:1.0.0' 
  compile 'com.google.guava:guava:19.0'
  compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
  
  compile 'com.madgag.spongycastle:core:1.54.0.0'
  compile 'com.madgag.spongycastle:prov:1.54.0.0'
  compile 'com.madgag.spongycastle:pkix:1.54.0.0'
  compile 'com.madgag.spongycastle:pg:1.54.0.0'
  </code></pre>
  
  <p>And in addition to Volley failures, <code>EventBus</code> from <code>Guava</code> doesn't work correctly too (subscribe events are not fetching). Do we have any solutions for these troubles? Should I add any additional information here?</p>