ProGuard not working when using on AdMob 6.1.0

748 views
Skip to first unread message

I.D.E.

unread,
Sep 10, 2012, 6:03:04 PM9/10/12
to Google AdMob Ads Developers
ProGuard doesn't work when using AdMob 6.1.0 for Android. I'm using
Eclipse Indigo Service Release 2 (Build id: 20120216-1857) and Android
SDK revision 15 (API level 15). No mediation.

Running ProGuard from Eclipse's Export option just shows this error:

Proguard returned with error code 1. See console
Warning: com.google.ads.util.e: can't find referenced class
android.annotation.TargetApi
Warning: com.google.ads.internal.j: can't find referenced class
android.annotation.TargetApi
Warning: com.google.ads.util.g: can't find referenced class
android.annotation.TargetApi
Warning: com.google.ads.util.h: can't find referenced class
android.annotation.TargetApi
You should check if you need to specify additional program
jars.
Warning: there were 4 unresolved references to classes or interfaces.
You may need to specify additional library jars (using '-
libraryjars'),
or perhaps the '-dontskipnonpubliclibraryclasses' option.
java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:308)
at proguard.ProGuard.initialize(ProGuard.java:210)
at proguard.ProGuard.execute(ProGuard.java:85)
at proguard.ProGuard.main(ProGuard.java:499)

I've seen similar reported problems, but none of their suggestions
worked for me:

http://groups.google.com/group/google-admob-ads-sdk/browse_thread/thread/8713af7186c37928/cc9de0c423a7aac1?lnk=gst&q=proguard+error#cc9de0c423a7aac1

http://groups.google.com/group/google-admob-ads-sdk/browse_thread/thread/1f966fe5ddfd87ec/74b1c879ed5f4316?lnk=gst&q=proguard+error#74b1c879ed5f4316

http://stackoverflow.com/questions/11143665/errors-using-proguard-and-googleadmobadssdk-6-0-1-jar-admob

Any ideas on how to fix? Do I need to update something?

Emanuel Moecklin

unread,
Sep 11, 2012, 9:30:42 AM9/11/12
to google-adm...@googlegroups.com
I'm using 6.1.0 with ProGuard with only these lines in proguard.cfg: 
-keep class com.google.ads**
-keep class com.mobfox**
-keep class com.inmobi**
I don't have any jar files referenced in the cfg file.
I don't use the -keepattributes *Annotation*.

Also I'm using Eclipse Helios 3.6.2 and Juno 4.2.0 instead of Indigo.

Do you have the latest versions of ADT and SDK Tools installed (both 20.0.3)?

Cheers
Emanuel

Markus Wiederkehr

unread,
Sep 11, 2012, 11:28:18 AM9/11/12
to google-adm...@googlegroups.com
Make sure you use the latest SDK and that you have annotations.jar listed under Android Dependencies in your project. If this alone does not help you could try to specify something like this in your proguard-project.txt:

-libraryjars /path/to/sdk/tools/support/annotations.jar

Markus
Reply all
Reply to author
Forward
0 new messages