Proguard rules not working with v3.7.1 Android

664 views
Skip to first unread message

Wesley Ellis

unread,
Mar 29, 2017, 6:07:58 AM3/29/17
to Interactive Media Ads SDK
The proguard rules that were previously suggested in https://groups.google.com/forum/#!searchin/ima-sdk/progaurd%7Csort:relevance/ima-sdk/yH7xkhuvHdA/9_h7BMskF2IJ are no longer working and are causing a Assertion Error when running a release build. Do you have any new rules? In the release notes for 3.7.1 it said some classes were moved to com.google, could this be it?

//No longer working in v3.7.1
-keep class com.google.ads.interactivemedia.** { *; }
-keep interface com.google.ads.interactivemedia.** { *; }

java.lang.AssertionError
                                         at com.google.obf.fk$a.<init>(IMASDK:17)
                                         at com.google.obf.fk$11.a(IMASDK:7)
                                         at com.google.obf.do.a(IMASDK:89)
                                         at com.google.obf.fi.write(IMASDK:10)
                                         at com.google.obf.fd$a.write(IMASDK:1041)
                                         at com.google.obf.do.a(IMASDK:11133)
                                         at com.google.obf.gs.b(IMASDK:15029)
                                         at com.google.obf.gs.b(IMASDK:273)
                                         at com.google.obf.gs.a(IMASDK:10090)
                                         at com.google.obf.gt$1.shouldOverrideUrlLoading(IMASDK:1039)
                                         at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:73)
                                         at com.android.webview.chromium.WebViewContentsClientAdapter.shouldOverrideUrlLoading(WebViewContentsClientAdapter.java:353)
                                         at org.chromium.android_webview.AwContentsClient.shouldIgnoreNavigation(AwContentsClient.java:168)
                                         at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:269)
                                         at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
                                         at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:41)
                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                         at android.os.Looper.loop(Looper.java:154)
                                         at android.app.ActivityThread.main(ActivityThread.java:6121)
                                         at java.lang.reflect.Method.invoke(Native Method)
                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

Chris Feldman (IMA SDK Team)

unread,
Mar 29, 2017, 11:41:02 AM3/29/17
to Interactive Media Ads SDK
Hi Ellis,

I suggest taking a look at the ProGuard file for our Advanced Example for Android. You should emulate the implementation from that project.

Regards,
Chris Feldman
IMA SDK Team

Roman Zimmer

unread,
Mar 29, 2017, 12:20:43 PM3/29/17
to Interactive Media Ads SDK
Hey there,

We had the same issue after updating to version 3.7.1.

The following ProGuard config seems to work fine for us:
-keep class com.google.ads.interactivemedia.** { *; }
-keep interface com.google.ads.interactivemedia.** { *; }
// new since 3.7.1
-keep class com.google.obf.** { *; }
-keep interface com.google.obf.** { *; }

Good luck,
Roman

Oliver Woodman

unread,
Jan 18, 2018, 11:27:56 AM1/18/18
to Interactive Media Ads SDK
Shouldn't IMA be distributed as a aar that includes its own proguard file, so that this happens automatically? It's error prone to rely on apps or other libraries that depend on IMA to figure out what the proguard rules need to be. See https://developer.android.com/studio/projects/android-library.html#aar-contents, in particular the "Library modules may include their own ProGuard configuration file" section.

Chris Feldman (IMA SDK Team)

unread,
Jan 18, 2018, 4:17:08 PM1/18/18
to Interactive Media Ads SDK
Hi Oliver,

Thank you for your suggestion. I will certainly pass this information along so we can assess whether or not this will be possible for the IMA SDK.

Regards,
Chris Feldman
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages