Error trying to build with UnityEngine.Advertisement

Hello, i’m trying to test the Code Sample from ADS(it’s already activated), but when i try to build, i get the error "The type or namespace name ‘Advertisements’ does not exist in the namespace ‘UnityEngine’(are you missing an assembly reference?)
I’m using Unity 5.5.0f3 Personal(64 bit) and using that code to test:
using UnityEngine;
using UnityEngine.Advertisements;

public class UnityAdsExample : MonoBehaviour
{
public void ShowAd()
{
if (Advertisement.IsReady())
{
Advertisement.Show();
}
}
}

Thanks for the attention :slight_smile:

Hi,

Have you selected Android or iOS as build target? You can also use UNITY_ADS conditional on non-supported platforms as shown in example code on https://docs.unity3d.com/ScriptReference/Advertisements.Advertisement.Show.html

Hope this helps.

/Rasmus