Can't access Mediation scripts when using Assembly Definitions in Unity

198 views
Skip to first unread message

James N

unread,
Jan 31, 2022, 1:54:33 AM1/31/22
to Google Mobile Ads SDK Developers
How can I access `UnityAds.SetGDPRConsentMetaData()` when I am using asmdef files in my game? I can't access it anymore since upgrading the GoogleMobileAds SDK (I was on v5.4.0).

It looks like newer versions of the GoogleMobileAds SDK use DLLs, instead of GoogleMobileAds.asmdef file. So because of that, all the mediation scripts are now in the default Assembly-CSharp which I can't reference anymore from my custom asmdef scripts.

Mobile Ads SDK Forum Advisor

unread,
Jan 31, 2022, 9:19:16 AM1/31/22
to oshi...@gmail.com, google-adm...@googlegroups.com

Hi James.

Thank you for reaching out to us.

With regard to your concern, you can check the optional steps for consent. Kindly note that the Unity C# code linked on the Unity Ads GDPR Compliance guide is not compatible with the mediation plugin for Unity Ads.

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2W2oym:ref

James N

unread,
Jan 31, 2022, 4:14:30 PM1/31/22
to Google Mobile Ads SDK Developers
Yeah that is what I've been trying to use - the "optional steps". But it's not working. Since you guys replaced the GoogleMobileAds.asmdef file with DLLs I can no longer reference the namespace `using GoogleMobileAds.Api.Mediation.UnityAds` because it is in the default Assembly-CSharp now.

Perhaps I'm doing something wrong, but since the mediation scripts aren't in a DLL anymore, I think you need to add back an asmdef file for the mediation scripts so that I can access `UnityAds.SetGDPRConsentMetaData(true)` in my custom asmdef file.

Mobile Ads SDK Forum Advisor

unread,
Feb 1, 2022, 11:40:15 PM2/1/22
to oshi...@gmail.com, google-adm...@googlegroups.com
Hi James,

Thank you for reporting this to us. Could you kindly share what version you were currently using and seen this kind of changes? Once provided, I'll share this to the rest of the team to get their insight as well.

Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2W2oym:ref

James N

unread,
Feb 2, 2022, 1:16:45 AM2/2/22
to Google Mobile Ads SDK Developers
So I came from using v5.4.0 of GoogleMobileAds (which had the asmdef file), and it looks like you guys changed over to DLLs in v6.0.0 on May 17, 2021. So every version since then has had that problem (including the current version v6.1.2, which is what I initially tried installing).

So again, the mediation packages used to be under the GoogleMobileAds.asmdef assembly (in v5.4.0). However, since you guys switched over to DLLs the mediation packages aren't under a Google asmdef file, so they reside under the default Assembly-CSharp; which I can't access from my scripts, because they are in their own custom asmdef files.

I just want to make sure that I get the GDPR consent right for UnityAds mediation, which is why I messaged you guys about this.

Mobile Ads SDK Forum Advisor

unread,
Feb 2, 2022, 9:23:32 AM2/2/22
to oshi...@gmail.com, google-adm...@googlegroups.com

Hi James,

Thank you for your response.

Let me share these details of yours to the rest of the team to further check it. Rest assured that one of our team will reach out to you.

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2W2oym:ref

Gideon Philip

unread,
Feb 20, 2022, 8:37:14 AM2/20/22
to James N, Google Mobile Ads SDK Developers
Hello please how can I start creating ads and app to be showing up please help 
.

Mobile Ads SDK Forum Advisor

unread,
Feb 21, 2022, 9:32:39 AM2/21/22
to gideonp...@gmail.com, google-adm...@googlegroups.com, oshi...@gmail.com

Hi Gideon,

Thank you for reaching out to us. 

If you're referring to the mediation for unity, we suggest checking our developer guide for mediation unity. You can also use the mediation test suite that allows you to test whether you have correctly configured your application and ad units to be able to display ads from third-party networks via AdMob mediation.

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 

 

ref:_00D1U1174p._5004Q2WxSAp:ref

pixels...@gmail.com

unread,
May 29, 2022, 2:24:06 AM5/29/22
to Google Mobile Ads SDK Developers
I'm facing the same issue. How was this solved?  To summarize, if you add a statement like "using GoogleMobileAds.Api.Mediation.UnityAds"  (or "using GoogleMobileAds.Api.Mediation.InMobi" etc.) to my game, it won't compile. This is because the GoogleMobileAds.Api.Mediation classes become part of Assembly-CSharp.dll and not part of GoogleMobileAds' asmdef unlike an older version. Without this, I can't send GDPR consent to each network using their custom API. This seems like a basic issue that should have been solved by now, but I have spent days and have not found an answer. 

Could someone from Google please help?  Please do not point me to the documentation on how to integrate UnityAds into admob - what I've pointed out is far more specific.



Mobile Ads SDK Forum Advisor

unread,
Jun 1, 2022, 11:35:35 PM6/1/22
to pixels...@gmail.com, google-adm...@googlegroups.com

Hi pixels,

 

This feature is not yet developed. That said, I understand and acknowledge your concern.

 

At the moment all I can suggest is writing GoogleMobileAds specific code in a location which does not require any custom assembly definitions.

 

Hope this helps,
Nick
 



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