title: Xamarin Android app crashes with missing google play service classes when Proguard enabled
body: <p>Without making any significant changes to our Xamarin Android app, yesterday our release builds started crashing on app startup:</p>
  
  <blockquote>
    <p>Didn't find class "com.google.android.gms.R$string"</p>
  </blockquote>
  
  <p>I suspect this is due to reaching some sort of class number limit. I have the multi-dex option checked in the project settings, and I also have android:name="android.support.multidex.MultiDexApplication" set on the application node in AndroidManifest.xml, so I wouldn't expect to hit any sort of limit.</p>
  
  <p>In any case, since multi-dex support isn't working, my next attempt to get it working was to enable Proguard to optimize the classes that are bundled in the app. I downloaded the latest proguard files (5.3.3) and deployed them to /android/sdk/tools/proguard. I updated the proguard-android.txt file to include the following lines:</p>
  
  <pre><code>-dontwarn sun.misc.Unsafe
  -keep public class com.google.android.gms.* { public *; }
  -dontwarn com.google.android.gms.**
  </code></pre>
  
  <p>However, when the app starts and it tries to use google location services, it crashes the app:</p>
  
  <blockquote>
    <p>Xamarin caused by: java.lang.NoSuchMethodError: no non-static method
    "Lcom/google/android/gms/internal/zzbym;.getLastLocation(Lcom/google/android/gms/common/api/GoogleApiClient;)Landroid/location/Location;"
      at
    md5ecd6d76dd0054fab042915172720bf10.LocationService.n_onConnected(Native
    Method)   at
    md5ecd6d76dd0054fab042915172720bf10.LocationService.onConnected(LocationService.java:35)
      at com.google.android.gms.common.internal.zzad.zzk(Unknown
    Source:108)</p>
  </blockquote>
  
  <p>I'm not sure what I'm missing, I thought the keep command above would ensure these classes were still included. What am I missing?</p>