Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Unity (test)Ads works in Editor, but not in Android Build. Help

Hello there, Its my first time attempting to implement Ads to a game. I have the Rewarded Ads option that appears on players fifth death. In editor, the sample Ad shows perfectly. But when I build it for android and try it there, on clicking the ads button, it does nothing.

I put texts in each case which would appear on screen, and from there I realized that in android it does initialize but goes no farther.

Here is my Ads Script

using UnityEngine;

using UnityEngine.Advertisements;

using UnityEngine.UI;

public class NewBehaviourScript : MonoBehaviour, IUnityAdsListener


  private string gameId = "12345679";

  private string gameAid = "12345678";

 // Button myButton;

  public string myPlacementId = "rewardedVideo";

public bool isTargetAppStore;

public bool isTestAD;

public Text CountTextt;


public GameObject myObject;

public GameObject myObject2;

public GameObject myObject3;

public GameObject myObject4;

public GameObject myObject5;


  // Start is called before the first frame update

  void Start() 


 Advertisement.AddListener (this);


if (!Advertisement.isInitialized)


CountTextt.text = "....";

Advertisement.Initialize(gameId, isTestAD);


else {

CountTextt.text = "..";}









    private void InitializeAdvertisement()



{Advertisement.Initialize(gameId, isTestAD); 



//Advertisement.Initialize(gameId, isTestAD);


  public void PlayRewardedVideo() {



CountTextt.text = "not ready";



 if(Advertisement.IsReady(myPlacementId)) {

CountTextt.text = "ready";


}  }

 public void OnUnityAdsReady (string placementId) {



  public void OnUnityAdsDidFinish (string placementId, ShowResult showResult) {

    // Define conditional logic for each ad completion status:

    if (showResult == ShowResult.Finished) {

      // Reward the user for watching the ad to completion.

CountTextt.text = "Finished";

if ( myObject != null) {


else if ( myObject2 != null) {


else if ( myObject3 != null) {


else if ( myObject4 != null) {


else if ( myObject5 != null) {




 else if (showResult == ShowResult.Skipped) {


CountTextt.text = "skipped";

    } else if (showResult == ShowResult.Failed) {

      // Debug.LogWarning (“The ad did not finish due to an error.”);


CountTextt.text = "failed";



  public void OnUnityAdsDidError (string message) {


CountTextt.text = "Error";


  public void OnUnityAdsDidStart (string placementId) {

    // Optional actions to take when the end-users triggers an ad.


//CountTextt.text = "Started";



Few more details

in editor, the first time I come across the ad bottun, it shows this text '....'

after that one time, all the other times it only shows '..'

, until I quit play mode.

and ofc in android it stays "...." and on clicking I does nothing, and just remains to show this text "...."

Any response will be appreciated, thankyou.


  • National Kidney Foundation of Illinois provide free educational programs and support for individuals living with kidney disease and their families, continuing education programs for healthcare professionals, advocacy to advance initiatives that directly affect the care and treatment of kidney disease, and free KidneyMobile screenings to Illinois residents who may be at risk for diabetes, high blood pressure and kidney disease.​

Sign In or Register to comment.