Problem Implementing unity adslisteners

I am facing a problem integrating the listeners for unity ads. i have gone through the tutorial of [this][1].
here is my codes

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;
public interface IUnityAdsListener
{
    void OnUnityAdsReady(string placementId);
    void OnUnityAdsDidError(string message);
    void OnUnityAdsDidStart(string placementId);
    void OnUnityAdsDidFinish(string placementId, ShowResult showResult);

}

and my unityAds code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEngine.UI;
using UnityEngine.Advertisements;
public class UnityAds : MonoBehaviour, IUnityAdsListener
{
    AddManager am;
    string gameId = "1234567";
    string myPlacementId = "rewardedVideo";
    bool testMode = true;

    // Initialize the Ads listener and service:
    void Start()
    {
        Advertisement.AddListener(this);
        Advertisement.Initialize(gameId, testMode);
    }

    // Implement IUnityAdsListener interface methods:
    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.
        }
        else if (showResult == ShowResult.Skipped)
        {
            // Do not reward the user for skipping the ad.
        }
        else if (showResult == ShowResult.Failed)
        {
            Debug.LogWarning("The ad did not finish due to an error.");
        }
    }

    public void OnUnityAdsReady(string placementId)
    {
        // If the ready Placement is rewarded, show the ad:
        if (placementId == myPlacementId)
        {
            Advertisement.Show(myPlacementId);
        }
    }

    public void OnUnityAdsDidError(string message)
    {
        // Log the error.
    }

    public void OnUnityAdsDidStart(string placementId)
    {
        // Optional actions to take when the end-users triggers an ad.
    }
}

i am getting error on

Advertisement.AddListener(this);

please help me solving this error. My ads were working perfectly without the listeners. but without listeners i cant track when users are rewarded or not. my sdk is 3.4.2
[1]: Unity developer integration guides

I don’t know if this will work, but consider making a private static object of your class, and then assign it to the listener. Here’s my code right here. It definitely does work.

Also, you want to be sure that your advertisement is ready to be shown, so use something like a while loop until the advertisement is ready. That’s mostly the reason why it won’t show I believe
using System.Collections;
using UnityEngine;
using UnityEngine.Advertisements;

public class GameOverScreen : MonoBehaviour, IUnityAdsListener
{
    private static IUnityAdsListener Instance;

    private void Awake()
    {
        Instance = this;  
    }

    private void Start()
    {
        Advertisement.Initialize("3789069");
    }
    public void OnTryAgain()
    {

    }

    /// <summary>
    /// Player gets extra live, but they have to watch an ad
    /// </summary>
    public void OnContinue()
    {
        ShowAd();
    }

    void ShowAd(string zone = "rewardedVideoZone")
    {
        Advertisement.AddListener(Instance);

        while (!Advertisement.IsReady())
            continue;

        OnUnityAdsReady(zone);
    }


    public void OnUnityAdsReady(string placementId)
    {
        Advertisement.Show(placementId);
    }

    public void OnUnityAdsDidError(string message)
    {
        Debug.Log(message);
    }

    public void OnUnityAdsDidStart(string placementId)
    {
        Debug.Log("Ad has started");
    }

    public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
    {
        switch (showResult)
        {
            case ShowResult.Failed:
                OnUnityAdsDidError("Ad came across an error.");
                break;
            case ShowResult.Skipped:
                Debug.Log("Ad was skipped.");
                //Remove Listener
                break;
            case ShowResult.Finished:
                Debug.Log("Yay! Ad is now finished!!!");
                Advertisement.RemoveListener(Instance);
                break;
            default:
                break;
        }
    }
}