Im using
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-places:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
The official docs says:
ProGuard directives are included in the Play services client libraries to preserve the required classes. The Android Plugin for Gradle automatically appends ProGuard configuration files in an AAR (Android ARchive) package and appends that package to your ProGuard configuration. During project creation, Android Studio automatically creates the ProGuard configuration files and build.gradle properties for ProGuard use. To use ProGuard with Android Studio, you must enable the ProGuard setting in your build.gradle buildTypes. For more information, see the ProGuard guide.
However, on using proguard without keeping any classes from play services I get the following exception:
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.location.places.ui.SupportPlaceAutocompleteFragment"
Then I was able to solve this problem by adding:
-keep class com.google.android.gms.** { *; }
It works perfectly but unfortunately the apk size has now increased by 1MB. It's not just about SupportPlaceAutocompleteFragment, if I use those libraries without keeping their classes even GCM and getLocation features stop working.
I feel I am doing something wrong because the official docs insist on not adding proguard rules for play services. Please help.