I have this method:
public void PlaceAd() {
Advertisement.Show("rewardedVideo");
}
but it generates a weird error message:
Assets\Project\Scripts\Runtime\UI\ShowAd.cs(50,7): error CS0433: The type ‘Advertisement’ exists in both ‘Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ and ‘UnityEngine.Advertisements, Version=3.6.1.0, Culture=neutral, PublicKeyToken=null’
I tried this:
public void PlaceAd() {
UnityEngine.Advertisements.Advertisement.Show("rewardedVideo");
}
but I still get the same error.
It sounds like you might have two versions of the Unity Ads code in your project, possibly from an import error?
I would recommend manually removing all Unity Ads plugins or related code from your Assets folder and then re-installing the package from the package manager.
Thanks… however I must say that, because my project is big, it was hard to figure out where those files were located. I thought everything resided in the “plugins” folder, so I deleted it, that was when I could import the package “Unity Ads”, I didn’t know that when you enable the Ad Service the editor automatically imports the “Advertisements” package. The problem came when I went to the Package Manager and I didn’t find the “Unity Ads” package installed… when a package is not listed in the project’s package, I think is reasonable to assume such package is not on your project. So if I had the “Advertisements” package installed and the “Unity Ads” not installed, then why I was getting this weird message?.. it was hard to realize that the Unity Ads files were actually located in the Standard Assets folder… once I deleted that folder the problem was solved.