Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Android Unity Ads Error "The imported type `UnityEngine.Advertisements.ShowResult' is defined multiple times"

$
0
0
I'm trying to get ads working on Android but I keep getting this error "The imported type `UnityEngine.Advertisements.ShowResult' is defined multiple times" Im not sure how to fix it. Here is my script using UnityEngine; using UnityEngine.Advertisements; public class ADManager : MonoBehaviour { public void ShowAd() { if (Advertisement.IsReady("rewardedVideoZone")) { var options = new ShowOptions { resultCallback = HandleShowResult }; Advertisement.Show("rewardedVideoZone", options); } } public void HandleShowResult(ShowResult result) { switch (result) { case ShowResult.Finished: Debug.Log("The ad was successfully shown."); break; case ShowResult.Skipped: Debug.Log("The ad was skipped before reaching the end."); break; case ShowResult.Failed: Debug.LogError("The ad failed to be shown."); break; } } } If anyone has any answers that would be great help. Thank you in advance.

Viewing all articles
Browse latest Browse all 2891

Trending Articles