Android Question FirebaseAdMob meta-data error

Hi everyone, I wanted to use the FirebaseAdMob library in my app and have followed the tutorial in the following thread https://www.b4x.com/android/forum/t...tegrated-with-firebase-backend.67710/#content .

I must have done something bad because I end up with this error :
B4X:
java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    at com.google.android.gms.common.GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(com.google.android.gms:play-services-basement@@17.1.1:17)
    at com.google.android.gms.common.GoogleApiAvailabilityLight.isGooglePlayServicesAvailable(com.google.android.gms:play-services-basement@@17.1.1:5)
    at com.google.android.gms.internal.ads.zzayk.zzc(com.google.android.gms:play-services-ads-lite@@18.3.0:67)
    at com.google.android.gms.internal.ads.zzvb.zzd(com.google.android.gms:play-services-ads-lite@@18.3.0:35)
    at com.google.android.gms.internal.ads.zzxl.zza(com.google.android.gms:play-services-ads-lite@@18.3.0:100)
    at com.google.android.gms.ads.BaseAdView.loadAd(com.google.android.gms:play-services-ads-lite@@18.3.0:15)
    at com.google.android.gms.ads.AdView.loadAd(com.google.android.gms:play-services-ads-lite@@18.3.0:18)
    at anywheresoftware.b4a.admobwrapper.AdViewWrapper.LoadAd(AdViewWrapper.java:122)
    at b4a.example.main._activity_create(main.java:422)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at b4a.example.main.afterFirstLayout(main.java:104)
    at b4a.example.main.access$000(main.java:17)
    at b4a.example.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:795)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:166)
    at android.app.ActivityThread.main(ActivityThread.java:6861)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:450)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

I used this code :

B4X:
Sub Process_Globals

End Sub

Sub Globals
   Private BannerAd As AdView
End Sub

Sub Activity_Create(FirstTime As Boolean)
   BannerAd.Initialize2("BannerAd", "ca-app-pub-3940256099942544/6300978111", BannerAd.SIZE_SMART_BANNER)
   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(BannerAd, 0dip, 100%y - height, 100%x, height)
   BannerAd.LoadAd
End Sub

If someone could please point out what I'm doing wrong, I think I should add something in the manifest but I'm not really sure what, thanks in advance.
 
Top