-1

ever since I am trying to implement adMob mediation I have been running into nightmares in my life. I dont know why I am getting this error of

    " error CS1061: 'GoogleMobileAdsSettings' does not contain a definition for 'IsAdMobEnabled' and no accessible extension method 'IsAdMobEnabled' accepting a first argument of type 'GoogleMobileAdsSettings' could be found (are you missing a using directive or an assembly reference?)"

I tried solving this by reimporting all assets and everything but nothing is happening. I again imported a new mediation plugin to see if the files are missing. But nothing seems to work out. I tried to upgrade the unity version as well.Error in Script

Before this I was getting the utils error,and I dont know what I did it got solved.

chethanv77777
  • 480
  • 9
  • 18

2 Answers2

1

The "IsAdMobEnabled" variable is removed from the "GoogleMobileAdsSettings" class in Admob unity plugin 6.0.0 or latest.

//=====Latest Setting

enter image description here

//=====Older Setting enter image description here

See the picture above (lastest setting one), that variable is removed. Means "Admob Ad Manager" is removed from the setting "Scriptable object" and "Google Admob" mode is totally enabled.

For you, you can consider the "Google Admob" as enabled and update your logic according to it.

1

Change GoogleMobileAdsSettings.Instance to GoogleMobileAdsSettings.LoadInstance() in every line it will work :)

MrTheMech
  • 11
  • 1
  • Kindly explain the reason this would work. – michael g Feb 10 '23 at 16:31
  • The error is because the plugin got updated and the way it handled the instances of itself got changed. I managed to read the code of the updated plugin and compared it with the old one to find a fix for this issue. So for others who are having this issue can follow my simple procedures to fix this issue without going through that code and debugging for a while. I hope this will help someone saving few hours! :) – MrTheMech Feb 12 '23 at 03:30