title: Proguard configuration when using Android Studio's Google Cloud Endpoints template
body: <p>We need to store and retrieve the content that users generate with our app online. To do so, we decided to use Android Studio's integrated Google Cloud Endpoints template to quickly create an API (official usage example<a href="https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloEndpoints" rel="noreferrer"> here</a>).</p>
  <p>It works fine in debug, but in release mode, with Proguard enabled, it fails. Worse still, I've failed to find any documentation or samples about using Proguard with the Android Studio's Endpoints templates.</p>
  <p>After an hour or so of poking around and trying to make it work, the <em>proguard-rules.pro</em> now looks like this:</p>
  <pre><code>-keep class com.google.api.** { public *; }
  -dontwarn com.google.api.**
  -keep class com.google.common.** { public *; }
  -dontwarn com.google.common.**
  
  # Not allowed to post company and app names, but this line is correct in the real file
  -keep class com.companyname.appname.application.backend.** { *; }
  </code></pre>
  <p>With this configuration, I'm getting a class cast exception in my <code>ArrayAdapter</code>:</p>
  <pre><code>java.lang.ClassCastException: com.google.api.client.util.ArrayMap cannot be cast to com.companyname.appname.application.backend.messageApi.model.Message
  </code></pre>
  <p>It seems the conversion of returned data isn't performed somewhere and, instead of a <code>List</code> of <code>Message</code> objects, I get a <code>List</code> of <code>com.google.api.client.util.ArrayMap</code> objects (they do contain valid data, by the way).</p>
  <p>I COULD check whether the app is running in release mode and do the conversion manually, however, it's a hacky way and I'd prefer to do it properly. So, can someone please tell me what I'm missing in the Proguard configuration file?</p>