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
I'm just using your tutorial code at the moment, to rule out any possible errors in my own....so I'm using this (which isn't working):

Dim height As Int
If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
'phones
If 100%x > 100%y Then height = 32dip Else height = 50dip
Else
'tablets
height = 90dip
End If
Activity.AddView(adView1, 0dip, 100%y - height, 100%x, height)
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've just tested it with this code and it works:
B4X:
adview1.Initialize2("Ad", "ca-app-pub-3940256099942544/6300978111", adview1.SIZE_SMART_BANNER)
Dim height As Int
If 100%x > 100%y Then height = 32dip Else height = 50dip
Activity.AddView(adview1, 0dip, 100%y - height, 100%x, height)
adview1.LoadAd
upload_2016-3-27_8-58-54.png
 
Upvote 0

buddypepper

Member
Licensed User
Longtime User
No such luck here - that code first gave me code 2, and then after that 0 again. Also tried it on BlueStacks, for comparison, and I see no ads.
 
Upvote 0
Top