Unity Ads SDK fail to initialize due to configuration error

Hi,

I implemented an ads banner at the bottom of my main menu.
While implementing I could see the banner in the editor.
I wanted to check it on my phone, so I disabled all test modes and created an iOS release.
I’ve run the app in my iPhone successfully but no banner was showing up.

I think I misconfigured something. e.g. the bundle id must be a specific one or sth like this, but in the resources of Unity they are only talking about placement and game ids which I used as described.

Xcode logs:

2020-07-17 14:31:37.905132+0200 SnakeReloaded[3741:1274602] I/UnityAds: +[USRVApiSdk WebViewExposed_logInfo:callback:] (line:67) :: Requesting configuration from https://publisher-config.unityads.unity3d.com/games/CENSORED/configuration?bundleId=CENSORED&encrypted=true&rooted=false&platform=ios&sdkVersion=3460&osVersion=13.5.1&deviceModel=iPhone11%2C2&language=de_DE&connectionType=cellular&screenHeight=812&screenWidth=375&test=false&analyticsUserId=CENSORED&analyticsSessionId=CENSORED&advertisingTrackingId=CENSORED&limitAdTracking=false&frameworkName=Unity&frameworkVersion=2019.4.4f1&adapterName=Packman&adapterVersion=3.4.6
2020-07-17 14:31:38.297836+0200 SnakeReloaded[3741:1274602] E/UnityAds: +[USRVApiSdk WebViewExposed_initError:code:callback:] (line:42) :: Web application failed to load with error : Unity Ads SDK fail to initialize due to configuration error
2020-07-17 14:31:38.301038+0200 SnakeReloaded[3741:1274602] E/UnityAds: +[USRVApiSdk WebViewExposed_logError:callback:] (line:57) :: Initialization error: Unity Ads SDK fail to initialize due to configuration error
1 Like

How are you initializing Unity Ads SDK in your code? Also, if you open the https://publisher-config.unityads.unity3d.com/games/… url above, what does it return?

/Rasmus

This is how I implement it, but the HTTP call is done by Unity. I just saw it in Xcode.
“banner” is the placement I created in my Unity dashboard.

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

public class AdBanner : MonoBehaviour
{
  private string gameIdApple = "XXXXXX";
  private string gameIdAndroid = "XXXXXX";
  private string placementId = "banner";

  void Start()
  {
    // Initialize the SDK if you haven't already done so:
#if UNITY_IPHONE
    Advertisement.Initialize(gameIdApple);
#endif
#if UNITY_ANDROID
    Advertisement.Initialize(gameIdAndroid);
#endif
    Advertisement.Initialize(gameIdAndroid);
    Advertisement.Banner.SetPosition(BannerPosition.BOTTOM_CENTER);
    StartCoroutine(ShowBannerWhenReady());
  }

  IEnumerator ShowBannerWhenReady()
  {
    while (!Advertisement.IsReady(placementId))
    {
      yield return new WaitForSeconds(0.5f);
    }
    Advertisement.Banner.Show(placementId);
  }
}

Oh man, it was a copy mistake in my code above.
In line 21 I initialize a second time with the game id for Android…
I removed this line and the error disappeared.

Now I’m getting No fill for placement banner
But it seems, that this is a expected behaviour to protect users for getting spammed with too much ads.

1 Like

Hi, I am getting the same error: Unity Ads SDK fail to initialize due to configuration error. I only have initialization for ios, so there cannot be such errors in the code

I found a bug. In the parameter I used a gameId of type “parameter”, not a string.

But now, I get the same error:
No fill for placement mainBanner :slight_smile:

Hi all, unfortunately, some regions have a lower banner supply than demand. This means that it’s possible for your games to request banners when none are available - and this is when the “no fill” error happens. There is unfortunately nothing we can do about this, but it does mean you have set up everything correctly and banners will show when they become available :slight_smile:

Hi Rasmus,

I have the same error: “Unity Ads SDK fail to initialize due to configuration error”
When I follow your link to publisher-config I get the message:
{“error”:“not found”}

What does this mean?

In Unity editor test ads work fine. They pop up and I’m able to reward the player.
When I build and run on my device the ads don’t work anymore.

I initialize on start:

private void Start()
    {
        debugPanel = GameObject.Find("Debug Panel");
        Advertisement.AddListener(this);

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            isTargetPlayStore = false;
        }
        else if (Application.platform == RuntimePlatform.Android)
        {
            isTargetPlayStore = true;
        }
        InitializeAdvertisement();
    }
    private void InitializeAdvertisement()
    {
        if (!isTargetPlayStore)
        {
            Advertisement.Initialize(appStoreID);
            return;
        }
        Advertisement.Initialize(playStoreID);
    }

On my device isTargetPlayStore is found to be true.

I configured ads in such a way, that I overwrite the test ad boolean through services:
6234564--686301--upload_2020-8-23_10-35-24.png

and here my services in unity editor:
6234564--686298--upload_2020-8-23_10-34-10.png

Thanks for your support!
Winthir

I tested the app. All was good.
Then the same issue happened accidentally: Unity Ads SDK fail to initialize due to configuration error.
Then - good.
Then - issue.

What is it?

I check the internet connection with [Internet Reachability Verifier] asset to check true connection before initializing Unity Ads.

I can’t see the status of Unity Ads servers here: https://status.unity.com . Please add it, @kyle-unity

Environment:

  • Unity Ads 3.6.1
  • Unity 2019.4.18
  • iOS 14.4
  • iPhone XS Max

Hey @makaka-org could you post a full device log of the error you are seeing?

sent in conversation. Is it related with this bug?

Thanks! Log received. Interestingly, it looks like you are seeing a http 500 error that is preventing the config call from succeeding. This means our server is producing an internal server error when your app is trying to initialize the SDK.

This means your app is working as expected, but the source of the error is on our end.

I’ll submit a bug report to the engineering team. Thanks for reporting!

1 Like

Update: looks like the team is already aware of this and it should be fixed today!

1 Like

Unity Ads SDK fail to initialize due to configuration error