- Home /
Errors with Unity Advertising after redownloading project and reenabling ads
Hello, I had to redownload my project after some changes that bugged my editor. After redownloading the project from Collab I had to re enable Ads in Services, which resulted in one of my scripts throwing these compiler errors:
Assets\Scripts\Ads\GiveReward.cs(19,57): error CS0433: The type 'ShowResult' exists in both 'UnityEngine.Advertisements.Editor, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.Advertisements, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
Assets\Scripts\Ads\GiveReward.cs(6,42): error CS0535: 'GiveReward' does not implement interface member 'IUnityAdsListener.OnUnityAdsDidFinish(string, ShowResult)'
The second error is invalid as the GiveReward script does implement the IUnityAdsListener, since it worked before the redownload and the script is unchanged, but both Unity and Visual studio refuse to acknowledge that.
Iam using Unity 2019.2.0f1 and Microsoft Visual Studio Community 2019 Version 16.5.1
UPDATE
Managed to fix the errors by using the Reimport All option. This however broke the ads completely as now they do work in Editor but not on my Android phone.
UPDATE 2
I wrote an email to Unity Ads support, according to them I had a duplicate Unity Ads SDK package installed. They replied earlier today with a fix that worked perfectly.
HOW TO FIX
'
I was told this fix by Unity Ads support.'
1. Remove the Ads SDK from Package ManagerUnity editor > Window > Package Manager > Uninstall Advertisement package
2. Disable Ads Service
Unity editor > Window > General > Services > Turn Ads service as OFF
3. Restart Unity Editor and download the newest Ads SDK from Asset Store
Restart Unity editor > Window > Asset Store > Search and import "Unity Monetization"
'
After that I tried to build an APK and it worked perfectly on my Android phone.
A big thank you to the support team.