Ads Don't Display on Android

Hi i have a problem… i have this script attached to the main camera to display the videoads (the example script on the docu).

using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;
public class ADHelper : MonoBehaviour {

    void Awake() {
        if (Advertisement.isSupported) {
            Advertisement.allowPrecache = true;
            Advertisement.Initialize("17507",false);
        } else {
            Debug.Log("Platform not supported");
        }
    }
   
    void OnGUI() {
        if(GUI.Button(new Rect(10, 10, 150, 50), Advertisement.isReady() ? "Show Ad" : "Waiting...")) {
            // Show with default zone, pause engine and print result to debug log
            Advertisement.Show(null, new ShowOptions {
                pause = true,
                resultCallback = result => {
                    Debug.Log(result.ToString());
                }
            });
        }
    }
}

when i try on my pc after few second the button text is “Show Ad” and if i click on the button, it show the example picture,
but if i try on my android tablet the button text is “Waiting” and don’t change state, so i can’t see the video…

I guess the problem is Advertisement.isReady() that on my pc became true after some seconds and on my mobile remain false why??

In your Initilization() method call, the second parameter is set false, disabling testMode. Would you mind setting it to true for the time being and trying the build again, just to make sure you’re getting sample ads in testMode?

I double checked the settings for your game. It looks good from our end.

Let me know how it works out.

Hi :slight_smile:
I double build and test my app using the test mode
so in the code:
Advertisement.Initialize(“17507”,true);
but i have the same problem… the text still remain “Waiting”.

Don’t know what’s wrong… becouse yesterday using this plug in another game i did it works fine (i see the videos) but with this game no :confused:

Hope there is a solution because i don’t want return to admob ç_ç

I’ve tested using your gameId, but I don’t get the same issue.

Would you mind trying it out with the demo script I’m using? It’s available in the following link:
https://gist.github.com/wcoastsands/3d003528a76f94fa2ede

i solved the problem :slight_smile: , i had a game object called UnityAds :slight_smile:

1 Like

You’re the second person I’ve seen report this issue. Going to be adding this as a bug with the asset package.

Thanks for reporting it!

Hi Nikkolai,

I just wanted to report that I also had a game object named UnityAds and renaming it allowed me to see the video test ad.

1 Like

Thank you for the report! I tried reproducing it last night but wasn’t getting the issue consistently. Trying to narrow down the conditions for it. How the GameObject is named looks to be part of the issue. Trying to figure out what’s causing the inconsistency now.

Thanks!

Hello. Im currently using UnityAd. Is it possible to show a picture banner to the video And not just a text button?

If you’re referring to the buttons that overlay the video ads, I’d like to see the same thing. Not sure yet if those buttons have to be skinned within within the SDK or if there’s some customization feature available to devs to set for themselves. I believe it’s the former, though. Would like to see the later, for better fit-and-finish and style integration.

On my list of things to look into. Thanks for bringing it up.

I am using UnityAdsHelper.cs which works in Unity Editor but not on actual device.

I tried both disable/enable TestMode. GameID and/or TestGameID but the result is same.

What I am doing wrong?

1 Like

I use Playmaker…can anyone tell me, if this code is right? :face_with_spiral_eyes: Because is don’t show ad in my Android Device Google Nexus Galaxy. :frowning:

1957565–126616–UnityAds_Initialize (1).cs (629 Bytes)
1957565–126617–UnityAds_ShowAd1.1.cs (1.81 KB)

Hi,

UnityAds are being showed in Editor but not on Device (they got stuck in the LogWhenUnityAdsIsInitialized() Coroutine.

What should I do to fix it?

Regards

Can you please start separate forum threads for individual topics, instead of overloading this thread? Thanks :slight_smile:

Ok, I will. Thank you.

Bro can i know what you do in order to get ads
I am having same problem as yours
Ads showing in editor but not in android device

Link is Not working.
i am getting the same issue.
How to solve it?
Thank you

Hi @AjayRtsDev ,

What error are you getting in your Android device log? You can see logs from Unity Ads SDK by running the following command from command line:

adb logcat -v time UnityAds:V UnityAdsTest:V "*:S"

Thanks,
Rasmus

Hi Rasmus
com.unity3d.services.core.misc.Utilities.writeFile() (line:127) :: Wrote file: /data/user/0/com.DefaultCompany.UnityAds/files/UnityAdsStorage-public-data.json
12-14 19:48:33.852 D/UnityAds(18944): com.unity3d.services.core.device.Storage.sendEvent() (line:86) :: Couldn’t send storage event to WebApp
12-14 19:48:33.856 D/UnityAds(18944): com.unity3d.services.core.misc.Utilities.writeFile() (line:127) :: Wrote file: /data/user/0/com.DefaultCompany.UnityAds/files/UnityAdsStorage-public-data.json
12-14 19:48:33.856 D/UnityAds(18944): com.unity3d.services.core.device.Storage.sendEvent() (line:86) :: Couldn’t send storage event to WebApp
12-14 19:48:33.871 D/UnityAds(18944): com.unity3d.ads.UnityAds.initialize() (line:495) :: ENTERED METHOD
12-14 19:48:33.871 D/UnityAds(18944): com.unity3d.services.ads.UnityAdsImplementation.initialize() (line:69) :: ENTERED METHOD
12-14 19:48:33.871 D/UnityAds(18944): com.unity3d.services.UnityServices.initialize() (line:36) :: ENTERED METHOD
12-14 19:48:33.871 I/UnityAds(18944): com.unity3d.services.UnityServices.initialize() (line:128) :: Initializing Unity Services 3.5.1 (3510) with game id 123456 in production mode
12-14 19:48:33.874 I/UnityAds(18944): com.unity3d.services.UnityServices.initialize() (line:146) :: Unity Services environment check OK
12-14 19:48:33.892 I/UnityAds(18944): com.unity3d.services.core.configuration.InitializeThread$InitializeStateConfig.execute() (line:289) :: Unity Ads init: load configuration from https://config.unityads.unity3d.com/webview/3.5.1/release/config.json
12-14 19:48:43.912 I/UnityAds(18944): com.unity3d.services.core.configuration.InitializeThread$InitializeStateConfig.execute() (line:289) :: Unity Ads init: load configuration from https://config.unityads.unity3d.com/webview/3.5.1/release/config.json
12-14 19:49:03.942 I/UnityAds(18944): com.unity3d.services.core.configuration.InitializeThread$InitializeStateConfig.execute() (line:289) :: Unity Ads init: load configuration from https://config.unityads.unity3d.com/webview/3.5.1/release/config.json
12-14 19:49:43.978 I/UnityAds(18944): com.unity3d.services.core.configuration.InitializeThread$InitializeStateConfig.execute() (line:289) :: Unity Ads init: load configuration from https://config.unityads.unity3d.com/webview/3.5.1/release/config.json

Unity Ads init: network error, waiting for connection events

This is the log.
Thank you