title: App Crash after signing app with resource shrinking and Proguard
body: <p>This is the first time I got this type of exception while building a signed APK. I searched a lot but could not find any useful information to fix this. </p>
  
  <p>Any information will help me a lot. Because I already spend a lot of time fixing this. I also want to reduce the APK size.</p>
  
  <p>I am creating a signed APK with below release settings and proguard</p>
  
  <pre><code>release {
      minifyEnabled true
      shrinkResources true
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  }
  </code></pre>
  
  <p>Proguard:</p>
  
  <pre><code>-dontwarn okhttp3.internal.platform.*
  -dontwarn java.nio.file.*
  -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  -dontwarn okio.**
  -dontwarn retrofit2.Platform$Java8
  -dontwarn javax.annotation.**
  -dontwarn kotlin.Unit
  -dontwarn retrofit2.-KotlinExtensions
  </code></pre>
  
  <p>After building a signed APK, I tried testing that and found that google and facebook login is not working (I am not using any other way to log in) and also app crash when I open Privacy policy or Terms Activity which request an API endpoint using Retrofit 2.</p>
  
  <pre><code>implementation 'com.squareup.retrofit2:retrofit:2.5.0'
  implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
  </code></pre>
  
  <p>Below is the logcat of the crash.</p>
  
  <pre><code>2018-12-31 15:24:42.054 15126-15126/com.sathi E/UncaughtException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.sathi.c.a.i$a.a()' on a null object reference
          at com.sathi.activities.PrivacyPolicyActivity$1.a(Unknown Source)
          at com.sathi.c.d$3.a(Unknown Source)
          at d.h$a$1$1.run(Unknown Source)
          at android.os.Handler.handleCallback(Handler.java:751)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:154)
          at android.app.ActivityThread.main(ActivityThread.java:6776)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
  2018-12-31 15:24:42.281 15126-15126/com.sathi E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.sathi, PID: 15126
      java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.sathi.c.a.i$a.a()' on a null object reference
          at com.sathi.activities.PrivacyPolicyActivity$1.a(Unknown Source)
          at com.sathi.c.d$3.a(Unknown Source)
          at d.h$a$1$1.run(Unknown Source)
          at android.os.Handler.handleCallback(Handler.java:751)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:154)
          at android.app.ActivityThread.main(ActivityThread.java:6776)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
  </code></pre>
  
  <p>I don't know what is the cause of this exception. Any information will help. Thanks in advance! </p>
  
  <p><strong>Update:</strong></p>
  
  <p>These are the Java Compile Warning which I am getting while building a sign APK file without Proguard but keeping <code>minifyEnabled true</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/96s2b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/96s2b.png" alt="enter image description here"></a></p>
  
  <p><strong>Answer:</strong></p>
  
  <p>Thanks to Reaz's Answer
  The issue was the model class which I used to get the response from Retrofit</p>
  
  <p>I added below line in my Proguard</p>
  
  <pre><code>-keepclassmembers class com.sathi.models.** { *; }
  </code></pre>