Follow

Why do I get a "'Advertisements' does not exist in the namespace 'UnityEngine' error"?

This error is caused by one of two issues:

  • You are building for a platform that is not supported by Unity Ads
  • You haven't enabled Unity Ads for your Project yet.

Try the following to resolve the problem:

  • Ensure that Unity Ads is toggled ON in the Services window (Window > Services).
  • Ensure that you've selected iOS or Android as a build target (File > Build Settings...).
  • If you're building your Project for an unsupported platform, you can add a UNITY_ADS conditional define that allows you to build with Unity Ads without affecting other platforms.

For more information, see documentation on platform dependent compilation.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Matt Ahrens

    I did all those things and I still get that error, but only when I try to build.

  • 0
    Avatar
    Unity Ads Support

    Hi Matt,

    I am sorry that this is happening.

    Please, can you submit a support ticket to unityads-support@unity3d.com?

    Thank you.

    Kind Regards

    Claire

Please sign in to leave a comment.