Android Question Error ClassCastException in CheckConsentAndAddAds

angel_

Well-Known Member
Licensed User
Longtime User
I have this error from Crashlytics


B4X:
Private Sub CheckConsentAndAddAds
    Dim m As MobileAds
    Wait For (m.Initialize) MobileAds_Ready
'    m.SetConfiguration(m.CreateRequestConfigurationBuilder(Array("94BEBAAE1A9C9C6B3928ED3DE75C7370"))) 'optional. Array with test device ids. See unfiltered logs to find correct id.

    If Ads.GetConsentStatus = "UNKNOWN" Or Ads.GetConsentStatus = "REQUIRED" Then
        Wait For (Ads.RequestConsentInformation(False)) Complete (Success As Boolean)
    End If
    If Ads.GetConsentStatus = "REQUIRED" And Ads.GetConsentFormAvailable Then
        Wait For (Ads.ShowConsentForm) Complete (Success As Boolean)
    End If

It corresponds to this line:

B4X:
Wait For (m.Initialize) MobileAds_Ready

Any ideas?
 

asales

Expert
Licensed User
Longtime User
Just for information, I check my Crashlytics reports and saw this same error in my apps.

This is new. In my reports it started in this week.

It only happens in Android 10+, in both type of projects (activities and b4xpages).
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…