Android Question Firebase AdMob v1.6 problem

danijel

Active Member
Licensed User
Longtime User
I am trying to follow this
but without success.

"If the app immediately crashes then it is likely that the app id is wrong. Start with the sample app id and then change it to your app id."
Yes, my apps crash immediately.
I tried both sample app id and my app id.

B4X:
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
*** Service (starter) Create ***
starter_service_create (java line: 149)
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(Unknown Source:39)
    at com.google.android.gms.common.GoogleApiAvailabilityLight.isGooglePlayServicesAvailable(Unknown Source:0)
    at com.google.android.gms.internal.ads.zzamu.zzbe(Unknown Source:7)
    at com.google.android.gms.internal.ads.zzjr.zza(Unknown Source:10)
    at com.google.android.gms.internal.ads.zzmb.zza(Unknown Source:32)
    at com.google.android.gms.ads.MobileAds.initialize(Unknown Source:7)
    at com.google.android.gms.ads.MobileAds.initialize(Unknown Source:1)
    at anywheresoftware.b4a.admobwrapper.AdViewWrapper$MobileAdsWrapper.Initialize(AdViewWrapper.java:347)
    at com.ddrmic.footballprediction.starter._service_create(starter.java:149)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
    at com.ddrmic.footballprediction.starter.onCreate(starter.java:56)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3544)
    at android.app.ActivityThread.-wrap4(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1786)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6944)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

B4A Sdk Manager: updated all recommended items
B4A: v8.50
Android.jar: android-28
firebase-ads: v18.3.0
FirebaseAdMob Library: v1.6

Added:
Service_Create:
Dim MobileAds As MobileAds
MobileAds.Initialize

Manifest:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
AddReplacement($ADMOB_APP_ID$, ca-app-pub-3940256099942544~3347511713)

When I add this to manifest and compile app, I can't find this string ca-app-pub-3940256099942544~3347511713 in AndroidManifest.xml.
Is that because I do not have newest B4A 9.5?
How can I add missing lines manually?
 

danijel

Active Member
Licensed User
Longtime User
I updated to B4A 9.5
but FirebaseAdMob v1.6 won't work.
As soon i clik on it in Libraries Manager I get error


And an error on compiling:
Organizing libraries. Error
Maven artifact not found: com.google.guava/listenablefuture

I tried to install missing stuff but there is nothing more:


I also tried to install Android - 29
and target path to
C:\Android\platforms\android-29\android.jar

How can I resolve this?
 
Upvote 0

danijel

Active Member
Licensed User
Longtime User
Only one link in the chain was missing.
I also needed to upgrade the B4A Sdk Manager.
Now everything is all right.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…