Test ads are not displayed

104 views
Skip to first unread message

NYAM

unread,
May 3, 2022, 10:36:03 AM5/3/22
to Google Mobile Ads SDK Developers
Test ads are not displayed

Hi Mobile Ads SDK Team.

I tried to display a test ad, but it returned an "Ad failed to load : 3" error and could not be displayed.
What is puzzling is that the App ID and Unit ID are using the sample provided by Admob.
I would like to know why I cannot display them. Thank you.


Describe your environment
Unity version: 2020.3.33f1
Google Mobile Ads Unity plugin version: 7.0.0
Platform: Android
Platform OS version: Android 11
Any specific devices issue occurs on: Tested on Pixel 3a
Mediation ad networks used, and their versions: NO

ID's
App ID : ca-app-pub-3940256099942544~3347511713 (Sample app ID)
Banner Unit ID : ca-app-pub-3940256099942544/6300978111 (Test unit ID)

StackTrace
04-30 12:04:18.891 17895 17925 I Ads     : Updating ad debug logging enablement.
04-30 12:04:18.906 17895 17933 W Ads     : Update ad debug logging enablement as false
04-30 12:04:19.349 17895 17925 I Unity   : Requesting Banner ad.
04-30 12:04:19.349 17895 17925 I Unity   : UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
04-30 12:04:19.349 17895 17925 I Unity   : UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
04-30 12:04:19.349 17895 17925 I Unity   : UnityEngine.Logger:Log (UnityEngine.LogType,object)
04-30 12:04:19.349 17895 17925 I Unity   : UnityEngine.Debug:Log (object)
04-30 12:04:19.349 17895 17925 I Unity   : AdmobScript:RequestBannerAd () (at /Users/xxx/Desktop/AdmobTest/Assets/AdmobTest/AdmobScript.cs:25)
04-30 12:04:19.349 17895 17925 I Unity   : GoogleMobileAds.Common.MobileAdsEventExecutor:Update ()
04-30 12:04:19.467 17895 17895 I Ads     : Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("xxx")) to get test ads on this device.
04-30 12:04:19.675 17895 18063 W Ads     : Not retrying to fetch app settings
04-30 12:04:19.756  4572 18070 I Ads     : SDK version: afma-sdk-a-v221310999.214106000.1
04-30 12:04:19.758  4572 18070 I Ads     : HTTP timeout: 60000 milliseconds.
04-30 12:04:20.186 17895 17895 I Ads     : Ad failed to load : 3
04-30 12:04:20.200 17895 18077 I Unity   : Banner ad failed to load with error: No ad config.
04-30 12:04:20.200 17895 18077 I Unity   : UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
04-30 12:04:20.200 17895 18077 I Unity   : UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
04-30 12:04:20.200 17895 18077 I Unity   : UnityEngine.Logger:Log (UnityEngine.LogType,object)
04-30 12:04:20.200 17895 18077 I Unity   : UnityEngine.Debug:Log (object)
04-30 12:04:20.200 17895 18077 I Unity   : AdmobScript:OnAdFailedToLoad (object,GoogleMobileAds.Api.AdFailedToLoadEventArgs) (at /Users/xxx/Desktop/AdmobTest/Assets/AdmobTest/AdmobScript.cs:57)
04-30 12:04:20.200 17895 18077 I Unity   : GoogleMobileAds.Api.BannerView:<ConfigureBannerEvents>m__1 (object,GoogleMobileAds.Common.LoadAdErrorClientEventArgs)
04-30 12:04:20.200 17895 18077 I Unity   : GoogleMobileAds.Android.BannerClient:onAdFailedToLoad (UnityEngine.AndroidJavaObject)
04-30 12:04:20.200 17895 18077 I Unity   : System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)


Test Code
```c#
using UnityEngine;
using GoogleMobileAds.Api;
using GoogleMobileAds.Common;

public class AdmobScript : MonoBehaviour
{
BannerView bannerView;

public void Start()
{
MobileAds.Initialize(HandleInitCompleteAction);
}

void HandleInitCompleteAction(InitializationStatus initStatus)
{
MobileAdsEventExecutor.ExecuteInUpdate(RequestBannerAd);
}

#region BANNER ADS

void RequestBannerAd()
{
#if DEBUG
Debug.Log("Requesting Banner ad.");
#endif

// These ad units are configured to always serve test ads.
#if UNITY_EDITOR
string adUnitId = "unused";
#elif UNITY_ANDROID
string adUnitId = "ca-app-pub-3940256099942544/6300978111";
#elif UNITY_IPHONE
string adUnitId = "ca-app-pub-3940256099942544/2934735716";
#else
string adUnitId = "unexpected_platform";
#endif

// Clean up banner before reusing
if (bannerView != null)
{
bannerView.Destroy();
}

// Create a 320x50 banner at top of the screen
bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);

bannerView.OnAdFailedToLoad += OnAdFailedToLoad;

// Load a banner ad
AdRequest request = new AdRequest.Builder().Build();
bannerView.LoadAd(request);
}

void OnAdFailedToLoad(object sender, AdFailedToLoadEventArgs args)
{
Debug.Log("Banner ad failed to load with error: "+args.LoadAdError.GetMessage());
}

#endregion
}
```
Referenced code

Mobile Ads SDK Forum Advisor

unread,
May 4, 2022, 6:22:54 AM5/4/22
to seo.o...@gmail.com, google-adm...@googlegroups.com

Hi Nyam,

Thank you for reaching out to us.

Upon checking this into our Sample App Unity sample helloworld using android 11, I was able to load ads on it. With that, can you provide us your sample app project where this behavior is happening so that we can check it in our end?

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002aPzLuQAK&entry.80707362=00105734
2. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 

 

 



ref:_00D1U1174p._5004Q2aPzLu:ref
Reply all
Reply to author
Forward
0 new messages