# Why is its not using ( using UnityEngine.Advertisements; )

**URL:** https://discussions.unity.com/t/why-is-its-not-using-using-unityengine-advertisements/678637
**Category:** Unity Ads
**Tags:** Unity-Ads-and-User-Acquisition
**Created:** [October 1, 2017, 12:38pm UTC](https://discussions.unity.com/t/why-is-its-not-using-using-unityengine-advertisements/678637 "2017-10-01T12:38:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![blueangel512](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/blueangel512/32/426772_2.png) [@blueangel512](https://discussions.unity.com/u/blueangel512)
#### Post date: [October 1, 2017, 12:38pm UTC](https://discussions.unity.com/t/why-is-its-not-using-using-unityengine-advertisements/678637/1 "2017-10-01T12:38:58Z")

</div>

![](https://europe1.discourse-cdn.com/unity/original/4X/4/8/9/489603ba65b114d5890f490bce86ce5aaa542e91.png)  
for some reason it’s not using “using UnityEngine.Advertisements;” and I’m not sure why.

```csharp
FileNotFoundException: Could not load file or assembly 'UnityEngine.Advertisements, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

```

---

<div class="post-metadata">

### Author: ![rasmus-unity](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@rasmus-unity](https://discussions.unity.com/u/rasmus-unity)
#### Post date: [October 1, 2017, 4:53pm UTC](https://discussions.unity.com/t/why-is-its-not-using-using-unityengine-advertisements/678637/2 "2017-10-01T16:53:53Z")

</div>

Which Unity version and have you switched platform to Android/iOS? Also please check the “Ads doesn’t initialize at all” section of [Issues with Ads from Services window? Missing assemblies? - look here](https://discussions.unity.com/t/676820) which has some troubleshooting steps

/Rasmus

---

<div class="post-metadata">

### Author: ![blueangel512](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/blueangel512/32/426772_2.png) [@blueangel512](https://discussions.unity.com/u/blueangel512)
#### Post date: [October 1, 2017, 5:41pm UTC](https://discussions.unity.com/t/why-is-its-not-using-using-unityengine-advertisements/678637/3 "2017-10-01T17:41:08Z")

</div>

> [@rasmus-unity](#):
>
> Which Unity version and have you switched platform to Android/iOS? Also please check the “Ads doesn’t initialize at all” section of [https://discussions.unity.com/t/676820](https://discussions.unity.com/t/676820) which has some troubleshooting steps
> 
> /Rasmus

I downloaded the assets that fixed the namespace and errors but now when I run the code and click the button the ad does not show for me. also, I’m using Android.

---

<div class="post-metadata">

### Author: ![rasmus-unity](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@rasmus-unity](https://discussions.unity.com/u/rasmus-unity)
#### Post date: [October 1, 2017, 7:22pm UTC](https://discussions.unity.com/t/why-is-its-not-using-using-unityengine-advertisements/678637/4 "2017-10-01T19:22:34Z")

</div>

Any error messages? You are welcome to share the code you are using for showing ads

/Rasmus

---

<div class="post-metadata">

### Author: ![blueangel512](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/blueangel512/32/426772_2.png) [@blueangel512](https://discussions.unity.com/u/blueangel512)
#### Post date: [October 2, 2017, 7:07pm UTC](https://discussions.unity.com/t/why-is-its-not-using-using-unityengine-advertisements/678637/5 "2017-10-02T19:07:39Z")

</div>

> [@rasmus-unity](#):
>
> Any error messages? You are welcome to share the code you are using for showing ads
> 
> /Rasmus

```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Advertisements;
using UnityEngine;

public class PlayAd : MonoBehaviour {

    public SuperGold rewardgold;

    public void ShowAd(){
        //if (Advertisement.IsReady ()) {
        var options = new ShowOptions(){resultCallback = HandleAdResult};
        Advertisement.Show ("rewardedVideo", options);
        //}
    }

    private void HandleAdResult(ShowResult result)
    {
        switch (result) {
        case ShowResult.Finished:
            rewardgold.supergold += 2;
            Debug.Log ("Player gains gold");
            break;

        case ShowResult.Skipped:
            //rewardgold.supergold += 2;
            Debug.Log("Player skipped ad");
            break;

        case ShowResult.Failed:
            //rewardgold.supergold += 2;
            Debug.Log ("Player failed to launch the ad,");
            break;
        }
    }
}

```

it says the ads Failed.
