SDK 6.0.0 verifyError, maybe proguard.cfg issue

813 views
Skip to first unread message

Roberto Conde Ojeda

unread,
Apr 26, 2012, 6:49:41 PM4/26/12
to google-adm...@googlegroups.com
I was giving a try to the new SDK (6.0.0), but an error ocurred while testing on a 1.6 avd.

04-27 00:22:23.198: E/AndroidRuntime(423): Uncaught handler: thread main exiting due to uncaught exception
04-27 00:22:23.208: E/AndroidRuntime(423): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mamuso.calcandroid/com.mamuso.calcandroid.lib.calcandroid}: android.view.InflateException: Binary XML file line #3: Error inflating class java.lang.reflect.Constructor
04-27 00:22:23.208: E/AndroidRuntime(423): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.app.ActivityThread.access$2100(ActivityThread.java:116)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.os.Handler.dispatchMessage(Handler.java:99)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.os.Looper.loop(Looper.java:123)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.app.ActivityThread.main(ActivityThread.java:4203)
04-27 00:22:23.208: E/AndroidRuntime(423): at java.lang.reflect.Method.invokeNative(Native Method)
04-27 00:22:23.208: E/AndroidRuntime(423): at java.lang.reflect.Method.invoke(Method.java:521)
04-27 00:22:23.208: E/AndroidRuntime(423): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
04-27 00:22:23.208: E/AndroidRuntime(423): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
04-27 00:22:23.208: E/AndroidRuntime(423): at dalvik.system.NativeStart.main(Native Method)
04-27 00:22:23.208: E/AndroidRuntime(423): Caused by: android.view.InflateException: Binary XML file line #3: Error inflating class java.lang.reflect.Constructor
04-27 00:22:23.208: E/AndroidRuntime(423): at android.view.LayoutInflater.createView(LayoutInflater.java:512)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:678)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.view.LayoutInflater.rInflate(LayoutInflater.java:613)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-27 00:22:23.208: E/AndroidRuntime(423): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:313)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.app.Activity.setContentView(Activity.java:1620)
04-27 00:22:23.208: E/AndroidRuntime(423): at com.mamuso.calcandroid.lib.calcandroid.onCreate(Unknown Source)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
04-27 00:22:23.208: E/AndroidRuntime(423): ... 11 more
04-27 00:22:23.208: E/AndroidRuntime(423): Caused by: java.lang.reflect.InvocationTargetException
04-27 00:22:23.208: E/AndroidRuntime(423): at com.google.ads.AdView.<init>(Unknown Source)
04-27 00:22:23.208: E/AndroidRuntime(423): at java.lang.reflect.Constructor.constructNative(Native Method)
04-27 00:22:23.208: E/AndroidRuntime(423): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
04-27 00:22:23.208: E/AndroidRuntime(423): at android.view.LayoutInflater.createView(LayoutInflater.java:499)
04-27 00:22:23.208: E/AndroidRuntime(423): ... 22 more
04-27 00:22:23.208: E/AndroidRuntime(423): Caused by: java.lang.VerifyError: com.google.ads.a.c
04-27 00:22:23.208: E/AndroidRuntime(423): at com.google.ads.a.q.a(Unknown Source)
04-27 00:22:23.208: E/AndroidRuntime(423): at com.google.ads.a.q.<init>(Unknown Source)
04-27 00:22:23.208: E/AndroidRuntime(423): ... 26 more

It only ocurred when making the application package and installing, not when debugging directly, so could it be a proguard.cfg issue?
It didn't happen on SDK 4.3.1.

This is my proguard.cfg:

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembers class * {
    native <methods>;
}
-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}


ChrisB

unread,
Apr 27, 2012, 1:21:49 PM4/27/12
to google-adm...@googlegroups.com
Hi Roberto,

I had the same problem and overcame it by adding the following:

-keep class com.google.ads.**

This really needs to be documented by the SDK team as it's not at all obvious until you package the app up and deploy to a (pre 2.0?) device.

Chris.

Message has been deleted

Roberto Conde Ojeda

unread,
Apr 27, 2012, 7:36:31 PM4/27/12
to google-adm...@googlegroups.com
Thank you! I will try it in the next update!

On Friday, April 27, 2012 9:05:15 AM UTC+2, ChrisB wrote:
Your correct Roberto.

Add -keep class com.google.ads.** to your proguard.cfg file.

This really should have been flagged up by the Admob team as it's not
apparent until you create a package for release. There is nothing in
the documentation about this.

Chris.
> > com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.jav a:313)

Stéphane

unread,
Apr 30, 2012, 5:11:27 AM4/30/12
to google-adm...@googlegroups.com
Hi,

I added this line.
-keep class com.google.ads.**

It works with "standard" ads, but it doesn't works with mediation ads:

W/Ads(14836): No server options fields detected. To suppress this message either add a field with the @Parameter annotation, or override the load() method
W/Ads(14836): Unexpected Server Option: pubid = '...'
W/Ads(14836): Unexpected Server Option: mad_hac = '1'

E/Ads(14836): Error while creating adapter and loading ad from ad network. Skipping ad network.
E/Ads(14836): java.lang.NullPointerException
E/Ads(14836): at com.google.ads.m.a(Unknown Source)
E/Ads(14836): at com.google.ads.AdView.a(Unknown Source)
E/Ads(14836): at com.google.ads.AdView.<init>(Unknown Source)
E/Ads(14836): at com.google.ads.mediation.admob.AdMobAdapter.a(Unknown Source)
E/Ads(14836): at com.google.ads.mediation.admob.AdMobAdapter.requestBannerAd(Unknown Source)
E/Ads(14836): at com.google.ads.mediation.admob.AdMobAdapter.requestBannerAd(Unknown Source)
E/Ads(14836): at com.google.ads.i.a(Unknown Source)
E/Ads(14836): at com.google.ads.i.run(Unknown Source)
E/Ads(14836): at android.os.Handler.handleCallback(Handler.java:605)
E/Ads(14836): at android.os.Handler.dispatchMessage(Handler.java:92)
E/Ads(14836): at android.os.Looper.loop(Looper.java:137)
E/Ads(14836): at android.app.ActivityThread.main(ActivityThread.java:4507)
E/Ads(14836): at java.lang.reflect.Method.invokeNative(Native Method)
E/Ads(14836): at java.lang.reflect.Method.invoke(Method.java:511)
E/Ads(14836): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
E/Ads(14836): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
E/Ads(14836): at dalvik.system.NativeStart.main(Native Method)

For the test, I just use 2 networks:
AdMob house Ads
Admob Network

I don't find solution. Any ideas ?

Stéphane.

Sebastian L (Berlin)

unread,
May 13, 2012, 5:09:25 AM5/13/12
to google-adm...@googlegroups.com
Its the same here, I get mediation to work in emulator (with Adfonic and MobFox) but the signed app do not show any apps on my phone.
I have the same errors in the Logs.

Best
Sebastian

Jasper Aarts

unread,
May 22, 2012, 11:25:58 AM5/22/12
to google-adm...@googlegroups.com
It seems the mediation depends on some Annotations.
Adding the following proguard parameter worked for me:
-keepattributes *Annotation*

Jasper
Reply all
Reply to author
Forward
0 new messages