This error is typically caused by one of two issues:
- You are building for a platform that is not supported by Unity Ads
- You have not imported the Unity Ads package into your project yet.
Try the following to resolve the problem:
- Ensure that you have installed Unity Ads, either via the Package Manage or the Asset Store package (but not both).
- 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.