'MobileAds' does not contain a definition for 'RaiseAdEventsOnUnityMainThread'

661 views
Skip to first unread message

Blake Phoenix

unread,
Mar 3, 2023, 12:58:42 PM3/3/23
to Google Mobile Ads SDK Developers
  • Google Mobile Ads SDK v7.4.1
  • Unity editor v2021.3.19f1 LTS
  • Target Platform: Android
  • App status: not published yet
The "Get Started" Admob initialization official guide suggests synchronizing Mobile Ads SDK events and callbacks with the main Unity thread by using the following line of code:

MobileAds.RaiseAdEventsOnUnityMainThread = true;

Unfortunately, if I use it, I get the following error:

Assets\Scripts\AdInitializerScript.cs(32,19): error CS0117: 'MobileAds' does not contain a definition for 'RaiseAdEventsOnUnityMainThread'.

I closely followed the implementation guide and everything else seems to be working, if I don't include that line. What could be causing this?


Mobile Ads SDK Forum Advisor

unread,
Mar 3, 2023, 3:19:00 PM3/3/23
to blake.j...@gmail.com, google-adm...@googlegroups.com

Hi Blake,

Thank you for reaching out to the Mobile Ads SDK team.

Before we provide more information on what cause this error, can you provide us the following information below so we can check it in our end?

  • Sample app project where this error is happening
  • Steps to replicate
  • Full stack trace
  • App Id
You can provide the following details via reply privately to author option or directly provide it to the link below.

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=5004Q00002jVn5qQAC&entry.80707362=00169603

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.

Regards,
Google Logo Mobile Ads SDK Team


ref:_00D1U1174p._5004Q2jVn5q:ref
Reply all
Reply to author
Forward
0 new messages