How to fix "error CS1061: 'GoogleMobileAdsSettings' does not contain a definition for 'IsAdMobEnabled'" in Unity

4.8k Views Asked by At

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.

2

There are 2 best solutions below

0
On

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.

2
On

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