Proguard rule for Google Play Services / Admob

如果在Android 程式上有使用Google Play ServicesAdmob API的朋友…
當你使用Proguard的時候…
有可能會令到這兩個API的功能出現問題…

大家只要在你們的Proguard Config 檔案內加內以下的設定便可以了
E.G.
proguard.cfg

proguard-android.txt

Google Play Services

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

Admob API

-keep public class com.google.ads.** { public *;}

詳情可以參考以下網頁
https://developers.google.com/mobile-ads-sdk/kb/
Hope you find it useful

2 thoughts on “Proguard rule for Google Play Services / Admob

  1. Bananaboy

    I see there is some html codes in your quoted. Are they mistakes?

    “-keep public class com.google.android.gms.ads.** { public *;}”

    Reply

Leave a Reply