Android Question Add Admobs to my app

Calvero

Member
Licensed User
Hi, sry for my english

I have tried to follow this tuto :

https://www.b4x.com/android/forum/threads/admob-tutorial-add-ads-to-your-application.7300/

but i still got a problem :

B4X:
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
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)
    at b4a.example.main._activity_create(main.java:456)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:702)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at b4a.example.main.afterFirstLayout(main.java:102)
    at b4a.example.main.access$000(main.java:17)
    at b4a.example.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:730)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5103)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy **

Hi have move this files android-support-v4.jar in this folder : C:\B4A\AdditionalLibraries

Even if i do that i got the same error...

Can someone help me please ?

Thanks by advance for answer.
 

Douglas Farias

Expert
Licensed User
Longtime User
B4X:
    #AdditionalRes: C:\Program Files (x86)\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
#AdditionalJar: android-support-v4
 
Upvote 0

An Schi

Well-Known Member
Licensed User
Did you check if the path is the same on your pc?
Did you check the sdk if you have downloaded this?
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
you have added this line too?
B4X:
#AdditionalJar: android-support-v4
you need have this line and the lib on b4a libs folder

if this dont work check your android-support-v4 lib size.
some days ago i check my v4 lib and the size its 35kb, later i find another one with 1389 KB on android sdk folder.

now i have the support v4 lib with 1389 KB on my b4a lib folder and fixed errors with android v4
 
Upvote 0

Calvero

Member
Licensed User
@An Schi =>

> Same path
> What do you mean ?

@Douglas Farias =>

I added this line yes.

Mine is 1389 Ko too.

FYI i have seen that this error happend only on emulator but not when i try with B4A Bridge on my phone...

But i need emulator to make screenshot, i have 2 emulator (AVD Manager, GenyMotion) both with this error.
 
Upvote 0
Top