Android Question FirebaseAdMob 1.60 - MobileAds

LucaMs

Expert
Licensed User
Longtime User
My test app (just ads "stuff") crashes always.
AdMob app ID is correct.

I'm using B4A V. 8.80; is FirebaseAdMob 1.60 compatible with this version?

(tried with android 28 & 29)


FATAL EXCEPTION: main
Process: com.test.rewardedvideotest, PID: 11677
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.MobileAdsInitProvider" on path: DexPathList[[zip file "/data/app/com.test.rewardedvideotest-B2CwMYjYXa1wmCN8pwJpEA==/base.apk"],nativeLibraryDirectories=[/data/app/com.test.rewardedvideotest-B2CwMYjYXa1wmCN8pwJpEA==/lib/arm64, /system/lib64, /vendor/lib64, /product/lib64]]
at android.app.ActivityThread.installProvider(ActivityThread.java:7209)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6693)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6594)
at android.app.ActivityThread.-wrap2(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.MobileAdsInitProvider" on path: DexPathList[[zip file "/data/app/com.test.rewardedvideotest-B2CwMYjYXa1wmCN8pwJpEA==/base.apk"],nativeLibraryDirectories=[/data/app/com.test.rewardedvideotest-B2CwMYjYXa1wmCN8pwJpEA==/lib/arm64, /system/lib64, /vendor/lib64, /product/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
 

LucaMs

Expert
Licensed User
Longtime User
Are you using the latest versions of all recommended items in B4A Sdk Manager?
I still use the "old" google sdk manager (I don't remember or maybe I just don't know why you added this to b4a), as it groups the items based on the Android versions.

Now I'm looking at those recommended by b4a.

I'll try (excluding the emulator, for example) and I'll let you know, Erel.

Thank you
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
The simplest solution is to upgrade to B4A v9+

Installed "all" recommended files (excluding those related to emulators)... crash again.

The same "project" works with b4a 9+ (my-our friend's b4a).

Upgrading to B4A 9+ is simpler, you're right, but also not as cheap :D (I prefer always the Enterprise version, of course).
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Did you configure B4A to use the newly installed SDK?
Means; Updating the Path to sdkmanager.bat and the path to android.jar
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
you should NOT use targetsdk 29 for now.
Use the android.jar from platform 28. Use targetsdk 28 in manifest.

Setting to 28 (but the one I have in c:\... not in appdata\local...)

No more crashes!

although I receive error 3 instead of advertising.
it's already a big step forward.
But I have to do a bit of order, instead of having various java in two places.
I installed sdk 29 in "local" because, strangely, it did not allow me to do it in c: as if my user was not an administrator (but it is the only one on the PC!)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Use the android.jar from platform 28. Use targetsdk 28 in manifest.
addition

If you want to use targetsdk 29 then you need to add SDK29 with the b4asdkmanager first.

Scroll down to Android-29->"Android SDK Platform 29 (Android 29)" <-- Install it
 
Upvote 0
Top