Hello every body…
Might be this is stupid to ask this question over again but i am not able to fixe it.
Basically i want to use unity advertisement but it alway show that “advertisement does not exist” exact error is:
“Assets/Scripts/Ads/UnityAds.cs(2,19): error CS0234: The type or namespace name
Advertisements' does not exist in the namespace UnityEngine’. Are you missing an assembly reference?”
Though i already enabled the advertisement form services and set my build setting to “IOS”.
When i try to download the unity advertisement from asset store then my unity cloud build alway got failed and showing the error:
[Unity] Assets/Scripts/Ads/UnityAds.cs(30,29): error CS0433: The imported type `UnityEngine.Advertisements.ShowResult’ is defined multiple times
[Unity] /UNITY_PATH/Unity/Unity-5_6_2f1/Unity.app/Contents/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll (Location of the symbol related to previous error)
Any kind of help will be appreciated.
Reference images :
Open services, turn ads off and then on again. That’s a simple Unity glitch. Happens when you work offline and then get back online.
I find the solution for this after long time.
Delete Library folder form your project.
path for the folder is: Project \Library
And also delete UnityConnectSettings file from your project path for the file is:
Project \ProjectSettings\ UnityConnectSettings.asset
Now open the unity project and let unity reconfigure your project. this will create Library folder and UnityConnectSetting.asset over again for you.
now from unity service window enable unity Advertisement.
if you imported unity Advertisement form unity asset store then remove it before doing above. by using unity asset “package uninstaller”.
But make sure that unity is not open by doing the above process.
which version of unity you used?
just go to ->Windows->sevices and enable adds … it will take just time and all done … or after that restart unity . (ctrl+O (windows)).
Just commented out all compilation errors. If you have links to Advertising namespace comment this links.
Then Enable Ads in Windows->Sevices. Only after this Unity will install missing DLLs. You will see compilation progress. After it has done uncomment usage of Advertising namespace.
Only this solution works for me.
My Unity 5.6.4f1
may be it’s too late to answer but, it can be solved by following these steps:
-close unity (save your project)
-go to project settings folder under the your project directory
- delete these two files 1. UnityAdsSettings.assets 2. UnityConnectionSettings.assets
-now re-open your project and turn on unity ads under services, you will not see the error again.
“What solved for me: I updated from 5.6.3p2 to 2018.3.0f2. Now “using UnityEngine.Advertisements” is not marked as a problem.”
Just Use: “using UnityEngine.Advertisements” BRU
Go to windows >package manager> and install advertisements