Android Question Admob crash

buddypepper

Member
Licensed User
Longtime User
I'm having a problem with the Admob lib - specifically, when I call .LoadAd, I get this error: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/SimpleArrayMap;

I suspect that this is because of a missing lib file or something...any ideas?
 

buddypepper

Member
Licensed User
Longtime User
It was the google-play-services.jar that I was missing - thanks! Now I'm not getting crashes, but I'm also not seeing any ads (on either the emulator, or a regular device). Will re-check my code later.....this might be a dumb question, but how would I go about checking a log file from a non-rooted device?
 
Upvote 0

buddypepper

Member
Licensed User
Longtime User
Thanks - I'm just getting error code 0, and not seeing any ads, it seems. Not sure what's wrong...any suggestions for debugging that?
 
Upvote 0

buddypepper

Member
Licensed User
Longtime User
I just checked it again after posting on Friday, and it's still just giving me error code 0 - that's over 24 hours now.
 
Upvote 0

buddypepper

Member
Licensed User
Longtime User
With the dummy ids, I'm using the emulator. The real ids, I've got on a stock samsung device...no ads on either of those.
 
Upvote 0

buddypepper

Member
Licensed User
Longtime User
Is there a way to turn on some detailed logging? All I can think of would be to use something like fiddler to watch the web traffic...
 
Upvote 0

asales

Expert
Licensed User
Longtime User
I have the same problem, only in Sony Xperia MiniPro with Android 4.0.4
This is a new app. In older apps, I don't get this error, even with a new compilation.
Don't have 24 hours that I made the ads, but I tried with dummy IDs and get the same error.
The Google account is ok, because other apps uses the same account and in other devices the app don't crash.
The Google Play Services is updated and it in additional libraries folder.

I don't understand what's happen.
I have similars apps that works in same device and in other devices the app works fine.

Libs: AdMob, AnimationPlus, ContentResolver, Core, Dialogs, id, inAppBilling3, JavaObject, mwAdmobInterstitial2, Phone, PinchZoomAndMove, RandomAccessFile, Reflection, SQL, StringUtils

android:minSdkVersion="14" android:targetSdkVersion="19"

B4X:
** Activity (main) Resume **
main_vvvvvvvvvvvvvvvvvvvvv6 (java line: 572)
java.lang.NoClassDefFoundError: android.support.v4.util.SimpleArrayMap
    at com.google.android.gms.ads.internal.zzs.<init>(Unknown Source)
    at com.google.android.gms.ads.internal.zzs.<init>(Unknown Source)
    at com.google.android.gms.ads.internal.zzb.<init>(Unknown Source)
    at com.google.android.gms.ads.internal.zzc.<init>(Unknown Source)
    at com.google.android.gms.ads.internal.zzf.<init>(Unknown Source)
    at com.google.android.gms.ads.internal.ClientApi.createBannerAdManager(Unknown Source)
    at com.google.android.gms.ads.internal.client.zzl.createBannerAdManager(Unknown Source)
    at com.google.android.gms.ads.internal.client.zze.zza(Unknown Source)
    at com.google.android.gms.ads.internal.client.zzab.zzdh(Unknown Source)
    at com.google.android.gms.ads.internal.client.zzab.zzdg(Unknown Source)
    at com.google.android.gms.ads.internal.client.zzab.zza(Unknown Source)
    at com.google.android.gms.ads.BaseAdView.loadAd(Unknown Source)
    at com.google.android.gms.ads.AdView.loadAd(Unknown Source)
    at anywheresoftware.b4a.admobwrapper.AdViewWrapper.LoadAd(AdViewWrapper.java:118)
 
Upvote 0

buddypepper

Member
Licensed User
Longtime User
In the tutorial, at the very end it says "make sure that the package name matches the value defined in 'package url' in AdMob site."

How do I find my package url, and what do I do with it? I don't see anywhere that says where to enter it for B4a...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
How do I find my package url, and what do I do with it? I don't see anywhere that says where to enter it for B4a...
It is not relevant anymore. I've removed this line from the tutorial.

You can try to upload your app without publishing it and then click on the "link app" link.
 
Upvote 0

buddypepper

Member
Licensed User
Longtime User
Hm - I've watched the logs using logcat now and I'm seeing this right around the time it's trying to get an ad:

W/GooglePlayServicesUtil( 1554): Google Play services is missing.
W/ActivityManager( 340): Unable to start service Intent { act=com.android.vendor.billing.InAppBillingService.BIND pkg=com.android.vending } U=0: not found
I/Ads ( 1554): Starting ad request.
I/Ads (1554): Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background in interstitial ad.

For what it's worth, I'm using a smart banner - or at least that's what I thought my code was: "adView1.Initialize2("Ad", "ca-app-pub-xxx", adView1.SIZE_SMART_BANNER)"

Why is it saying that GP services is missing? Would that be causing this problem?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…