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.