ConsentForm.loadConsentForm in flutter stopped working

122 views
Skip to first unread message

Martin Ryan

unread,
Dec 23, 2024, 5:11:59 AM12/23/24
to Google Mobile Ads SDK Developers
I was doing a routine update of my app dependencies when I hit this error running the app on Android Studio.

I/flutter (17369): * * Starting Consent Form Loading * *
I/flutter (17369): ConsentStatus.obtained
D/UserMessagingPlatform(17369): Receive consent action: consent://consent/?action=start_transparency_status_updates
D/UserMessagingPlatform(17369): Action[start_transparency_status_updates]: {}
D/UserMessagingPlatform(17369): Receive consent action: consent://consent/?action=configure_app_assets
D/UserMessagingPlatform(17369): Action[configure_app_assets]: {}
D/UserMessagingPlatform(17369): Receive consent action: consent://consent/?action=start_transparency_status_updates
D/UserMessagingPlatform(17369): Receive consent action: consent://consent/?action=configure_app_assets
D/UserMessagingPlatform(17369): Wall html loaded.
D/UserMessagingPlatform(17369): Wall html loaded.
D/UserMessagingPlatform(17369): Action[start_transparency_status_updates]: {}
D/UserMessagingPlatform(17369): Action[configure_app_assets]: {}
E/AndroidRuntime(17369): FATAL EXCEPTION: Google consent worker #1
E/AndroidRuntime(17369): Process: com.mrr358.scratchpad, PID: 17369
E/AndroidRuntime(17369): java.lang.IllegalArgumentException: width and height must be > 0
E/AndroidRuntime(17369): at android.graphics.Bitmap.createBitmap(Bitmap.java:1197)
E/AndroidRuntime(17369): at android.graphics.Bitmap.createBitmap(Bitmap.java:1163)
E/AndroidRuntime(17369): at android.graphics.Bitmap.createBitmap(Bitmap.java:1111)
E/AndroidRuntime(17369): at android.graphics.Bitmap.createBitmap(Bitmap.java:1070)
E/AndroidRuntime(17369): at com.google.android.gms.internal.consent_sdk.zzbx.zzd(com.google.android.ump:user-messaging-platform@@3.1.0:7)
E/AndroidRuntime(17369): at com.google.android.gms.internal.consent_sdk.zzbw.run(Unknown Source:2) 

My code has been working since early 2024  and is relatively simple

print('* * Starting Consent Form Loading * *');
ConsentStatus? consentStatus;
consentStatus = await ConsentInformation.instance.getConsentStatus();
print(consentStatus);
try {
ConsentForm.loadConsentForm((consentForm) async {
// Fetch consent status
try {
consentStatus = await ConsentInformation.instance.getConsentStatus();
} catch (error) {
print('Error getting consent status: $error');
completer.complete(FormError(message: error.toString(), errorCode: 109 ));
return;
}

Consent was obtained so consentform.show wasn't required.
This is what I have in my app gradle file

dependencies {
// removed this line as covered elsewhere 05/04/2024
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.android.gms:play-services-ads:23.6.0' // was 22.1.0 ; 22.4.0; 22.6.0 08/04/2024
implementation platform('com.google.firebase:firebase-bom:33.7.0') // was 29.3.1; 31.2.2 08/04/2024
implementation 'com.google.firebase:firebase-analytics'
implementation("com.google.android.ump:user-messaging-platform:3.1.0")
}


Any one else seeing this issue. Are there any recent changes that may have caused this?

Thanks

Martin

Mobile Ads SDK Forum Advisor

unread,
Dec 23, 2024, 9:38:12 AM12/23/24
to mrr...@gmail.com, google-adm...@googlegroups.com

Hi Martin,

Thank you for contacting the Mobile Ads SDK Support team.

I have executed our Google Sample project and am unable to reproduce the issue. Could you confirm whether the mentioned issue is reproducible in our Sample project? If yes, kindly provide the below information via reply to author option for further investigation:

  • app ID
  • ad unit ID
  • Mobile Ads SDK Version 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGqDY:ref" (ADR-00279606)

Thanks,
 
Google Logo Mobile Ads SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



Martin Ryan

unread,
Dec 24, 2024, 3:02:04 PM12/24/24
to Google Mobile Ads SDK Developers
I will have a look at the sample application

Meanwhile I have minimalised the use to just calling "requestConsentInfoUpdate" and no more. It then continues but fails with the same set of messages but the trigger is my first call to firebase to read a record.

class GdprHelper {
// this function calls the initial set of consents
// it will only trigger if GDPR applies

Future<FormError?> setPrivacyPreferences(BuildContext context) async {
final completer = Completer<FormError?>();
final params = ConsentRequestParameters();

ConsentInformation.instance.requestConsentInfoUpdate(params, () async {
if (await ConsentInformation.instance.isConsentFormAvailable()) {
await _loadConsentFormV2(context);
} else {
// There is no message to display,
// so initialize the components here.
await _initialize(context);
} 


I also get these warnings after flutter clean

version of sdk as already provided is 'com.google.android.gms:play-services-ads:23.6.0'

If I skip the calls to the consentinfo functions altogether my app happily loads and displays test ads 

Mobile Ads SDK Forum Advisor

unread,
Dec 24, 2024, 3:54:18 PM12/24/24
to mrr...@gmail.com, google-adm...@googlegroups.com
Hi,

We require more detailed debug information to effectively diagnose this issue. To move forward, please create and share a project where the issue can be reproduced. This will provide us with full visibility into your implementation and the dependency versions used in your project, allowing for further investigation.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002vGqDYQA0&entry.80707362=00279606

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
 

Martin Ryan

unread,
Jan 2, 2025, 12:21:52 PMJan 2
to Google Mobile Ads SDK Developers
I have taken the banner_example app and recreated the problem I was experiencing.


This created the attached file in android>src>main>res>mipmap-anydpi-v26

This file appears to be creating an adapative icon:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
</adaptive-icon>

I don't use adaptive icons and it should not have created this file so I will lodge this with the package authors.

If I delete the file the banner_example builds ok without the reported error. Put it back and it fails. I reloaded the banner_example app afresh and made this one change and caused it to fail.

/AndroidRuntime( 2521): FATAL EXCEPTION: Google consent worker #1
E/AndroidRuntime( 2521): Process: com.example.banner_example, PID: 2521
E/AndroidRuntime( 2521): java.lang.IllegalArgumentException: width and height must be > 0
E/AndroidRuntime( 2521): at android.graphics.Bitmap.createBitmap(Bitmap.java:1197)
E/AndroidRuntime( 2521): at android.graphics.Bitmap.createBitmap(Bitmap.java:1163)
E/AndroidRuntime( 2521): at android.graphics.Bitmap.createBitmap(Bitmap.java:1111)
E/AndroidRuntime( 2521): at android.graphics.Bitmap.createBitmap(Bitmap.java:1070)
E/AndroidRuntime( 2521): at com.google.android.gms.internal.consent_sdk.zzca.zzd(com.google.android.ump:user-messaging-platform@@3.0.0:7)
E/AndroidRuntime( 2521): at com.google.android.gms.internal.consent_sdk.zzbz.run(Unknown Source:2)
E/AndroidRuntime( 2521): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/AndroidRuntime( 2521): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/AndroidRuntime( 2521): at java.lang.Thread.run(Thread.java:1012)
I/Process ( 2521): Sending signal. PID: 2521 SIG: 9

I think therefore this is a concern for the admob team - if the presence of a specific adaptive icon file can cause this error then your API should be able to manage it.

I'm happy that the issue is closed. Posting it here in case other users experience the same issue.

Kind regards

Martin
ic_launcher.xml

Zauzau Francis

unread,
Jan 30, 2025, 12:31:53 PMJan 30
to Mobile Ads SDK Forum Advisor, mrr...@gmail.com, google-adm...@googlegroups.com

Enoch Francis  invites you to earn money together! No investment required, everyone can withdraw money! -> https://www.freeagqstar.top/p?0129797803862207069&s=mail someone has just cash out today


--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-admob-ads-sdk/EtFlF000000000000000000000000000000000000000000000SP0NBQ000OeHAS_URDuYjTgmEh2u6w%40sfdc.net.

Zauzau Francis

unread,
Jan 31, 2025, 11:45:21 AMJan 31
to Martin Ryan, Google Mobile Ads SDK Developers

Enoch Francis  invites you to earn money together! No investment required, everyone can withdraw money! -> https://www.freeagqstar.top/p?0129797803862207069&s=mail someone has just cash out today


--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages