The ad unit ID can only be set once on AdView.

27 views
Skip to first unread message

Sahar Fatima

unread,
Jun 17, 2024, 7:04:06 AM (9 days ago) Jun 17
to Google Mobile Ads SDK Developers
Dear team,
                  Sometimes i get this the following error message"   Non-fatal Exception: java.lang.IllegalStateException: The ad unit ID can only be set once on AdView."
i am setting adUnitID programmatically . i am using 2 different fixed size banner in 2 different fragment with 2 different AdUnitID. i am currently using version com.google.android.gms:play-services-ads:20.6.0. please help me to solve it.

Mobile Ads SDK Forum Advisor

unread,
Jun 17, 2024, 9:54:45 AM (9 days ago) Jun 17
to saharfat...@gmail.com, google-adm...@googlegroups.com
Hi,

Thank you for contacting us.

You are using older versions of GMA SDK. Use the latest Google Mobile Ads SDK so that you have access to all the privacy compliance features. Kindly upgrade to latest version available in release notes. If you still face the issue after the update kindly get back with the following information:
  • screen recording of the issue with steps to reproduce.
  • sample project replicating the issue.
  • do you observe this issue in testing environment?
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tJMFP:ref" (ADR-00241787)

Thanks,
 
Google Logo Mobile Ads SDK Team

 

newsam samapios newsam

unread,
Jun 17, 2024, 2:31:46 PM (9 days ago) Jun 17
to saharfat...@gmail.com, google-adm...@googlegroups.com

Olá acredito que ao usar  o Java com outro id de bloco diferente está entrando em conflito exclua um dos IP e ré instale


--

---
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 on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/aeaa9ee9-ce7c-4a01-a006-056ab9a691e0n%40googlegroups.com.

Mobile Ads SDK Forum Advisor

unread,
Jun 25, 2024, 7:59:27 AM (yesterday) Jun 25
to saharfat...@gmail.com, google-adm...@googlegroups.com

Hi Sahar,

It has come to our attention that we have not received any files that you have purportedly shared with us. kindly share them again so we can review it and try to replicate the problem. After doing so, we will be better equipped to offer a solution.

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 via reply to author option or 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=5004Q00002tJMFPQA4&entry.80707362=00241787

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.

Mobile Ads SDK Forum Advisor

unread,
Jun 25, 2024, 10:32:28 AM (yesterday) Jun 25
to google-adm...@googlegroups.com, saharfat...@gmail.com
Hi,

Whenever you're about to load ads in adView, you should check any ads are loaded in that view, if yes then it should clean up properly:

if (bannerId != null and mAdManagerAdView == null)
{continue your code}
Else
{Clean up old AdView}

Also it is recommend to use latest SDK. Kindly provide us the app flow and please confirm whether you are using different AdViews for different activities.
Reply all
Reply to author
Forward
0 new messages