旧. -開発日記-

〜とあるプログラマーのつぶやきや開発メモなど〜

Google Play Services SDKを使った際のProGuard設定

超絶久々に備忘録として...。
先日Google Play Servicesを導入して、いざapkに吐き出そうとした時
見たこともないエラーがズラズラと。
ProGuardを使った場合なんですが。その時解決した方法をば。

proguard-project.txtに以下を記述

-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

# google play services libディレクトリにあるproguard.txtをまんまもってくる
-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

# Keep SafeParcelable value, needed for reflection. This is required to support backwards
# compatibility of some classes.
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

# Keep the names of classes/members we need for client functionality.
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

# Needed for Parcelable/SafeParcelable Creators to not get stripped
-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}