Unity Ads – The name Advertisement does not exist in the current context

unity3d name Advertisement does not exist in the current context

This article is a troubleshooting to a well-known error that appears while using Unity Ads – The name Advertisement does not exist in the current context.

The solution is incredibly simple!

This error appears because you didn’t set up Advertisements support for you project. There’s a special tab in Unity editor called Services. There is a bunch of settings. Among them – Advertisements support.

You should know, that before you use Unity Ads, you should register an account there. If you do not have a published application, specify it in a corresponding field.

Fixing “The name Advertisement does not exist in the current context”

There are 3 simple steps to begin working with Unity Ads:

Go to Services tab (Window – Services) and enter your personal data – developer id and project’s name:

unity advertisement does not exist

Then click Link button and you will se the list of Unity Services. Now enable the support for Unity Ads service by clicking on the “Ads” section and then switching the trigger on the Ads settings:

unity advertisement does not exist enabling ads

And the last step. If you want to test the advertisements inside of the editor, don’t forget to specify this option:

Advertisement does not exist in the current context

This one provides a possibility to show a sub ad while testing your app in the editor.

When you’re done with all that your code will compile and you will not get the error “Advertisement does not exist in the current context” anymore.

Leave a Reply

1 Comment on "Unity Ads – The name Advertisement does not exist in the current context"


Guest
JustACoder
1 year 10 months ago

I have done all these steps and still see the error in monodevelop but works in the editor. Do the calls always have to be in compilation conditional statements or something?