Android Question AdRequestBuilder crashing when built with B4A Version 13

skaliwag

Member
Licensed User
Longtime User
I have been using AdRequestBuilder with the OldGoogleConsent library without problem for some time

B4X:
Sub LoadAd(AdmobView As AdView)
    Dim builder As AdRequestBuilder
    builder.Initialize
    Dim consent As ConsentManager = Starter.consent
    If consent.IsRequestLocationInEeaOrUnknown Then
        If consent.ConsentState = consent.STATE_NON_PERSONALIZED Or consent.ConsentState = consent.STATE_UNKNOWN Then
            builder.NonPersonalizedAds
        End If
    End If
    AdmobView.LoadAdWithBuilder(builder)
End Sub

With apps targetting SDK 34, I am getting the error
Correction the target SDK does not seem to matter
It seems to happen whenever it is built with B4A Version 13
Exception java.lang.NoSuchMethodError:
at anywheresoftware.b4a.admobwrapper.AdViewWrapper$AdRequestBuilderWrapper.NonPersonalizedAds (AdViewWrapper.java:285)

Can anyone help with this?
 
Last edited:

skaliwag

Member
Licensed User
Longtime User
JDK 19.02
commandlinetools-win-9123335_latest
resources_7_24

Full Error

common_vvvvvvvvvvvv4 (java line: 3003)
java.lang.NoSuchMethodError: No virtual method addNetworkExtrasBundle(Ljava/lang/Class;Landroid/os/BundleLcom/google/android/gms/ads/AdRequest$Builder; in class Lcom/google/android/gms/ads/AdRequest$Builder; or its super classes (declaration of 'com.google.android.gms.ads.AdRequest$Builder' appears in /data/app/~~WX1D8SaSc1_t4dQh4WHLeg==/uk.co.stefsquared.vanguard-uC1gsnypvEIGPE9R9oR3Kg==/base.apk)
at anywheresoftware.b4a.admobwrapper.AdViewWrapper$AdRequestBuilderWrapper.NonPersonalizedAds(AdViewWrapper.java:285)
at uk.co.stefsquared.vanguard.common._vvvvvvvvvvvv4(common.java:3003)
at uk.co.stefsquared.vanguard.main$ResumableSub_ConsentStateAvailable.resume(main.java:1382)
at uk.co.stefsquared.vanguard.main._consentstateavailable(main.java:1326)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at anywheresoftware.b4a.keywords.Common$12.run(Common.java:1212)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8592)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
common_vvvvvvvvvvvv4 (java line: 3003)
java.lang.NoSuchMethodError: No virtual method addNetworkExtrasBundle(Ljava/lang/Class;Landroid/os/BundleLcom/google/android/gms/ads/AdRequest$Builder; in class Lcom/google/android/gms/ads/AdRequest$Builder; or its super classes (declaration of 'com.google.android.gms.ads.AdRequest$Builder' appears in /data/app/~~WX1D8SaSc1_t4dQh4WHLeg==/uk.co.stefsquared.vanguard-uC1gsnypvEIGPE9R9oR3Kg==/base.apk)
at anywheresoftware.b4a.admobwrapper.AdViewWrapper$AdRequestBuilderWrapper.NonPersonalizedAds(AdViewWrapper.java:285)
at uk.co.stefsquared.vanguard.common._vvvvvvvvvvvv4(common.java:3003)
at uk.co.stefsquared.vanguard.main$ResumableSub_ConsentStateAvailable.resume(main.java:1382)
at uk.co.stefsquared.vanguard.main._consentstateavailable(main.java:1326)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at anywheresoftware.b4a.keywords.Common$12.run(Common.java:1212)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8592)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…