Search Unity

Unity Ads SDK fail to initialize due to configuration error

Discussion in 'Unity Ads & User Acquisition' started by Waterfront, Jul 17, 2020.

Thread Status:
Not open for further replies.
  1. Waterfront

    Waterfront

    Joined:
    Jul 9, 2020
    Posts:
    3
    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:
    Code (CSharp):
    1.  
    2. 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
    3. 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
    4. 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
    5.  
     
    Last edited: Jul 19, 2020
    makaka-org likes this.
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
  3. Waterfront

    Waterfront

    Joined:
    Jul 9, 2020
    Posts:
    3
    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.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Advertisements;
    5.  
    6. public class AdBanner : MonoBehaviour
    7. {
    8.   private string gameIdApple = "XXXXXX";
    9.   private string gameIdAndroid = "XXXXXX";
    10.   private string placementId = "banner";
    11.  
    12.   void Start()
    13.   {
    14.     // Initialize the SDK if you haven't already done so:
    15. #if UNITY_IPHONE
    16.     Advertisement.Initialize(gameIdApple);
    17. #endif
    18. #if UNITY_ANDROID
    19.     Advertisement.Initialize(gameIdAndroid);
    20. #endif
    21.     Advertisement.Initialize(gameIdAndroid);
    22.     Advertisement.Banner.SetPosition(BannerPosition.BOTTOM_CENTER);
    23.     StartCoroutine(ShowBannerWhenReady());
    24.   }
    25.  
    26.   IEnumerator ShowBannerWhenReady()
    27.   {
    28.     while (!Advertisement.IsReady(placementId))
    29.     {
    30.       yield return new WaitForSeconds(0.5f);
    31.     }
    32.     Advertisement.Banner.Show(placementId);
    33.   }
    34. }
    35.  
     
    Last edited: Jul 18, 2020
  4. Waterfront

    Waterfront

    Joined:
    Jul 9, 2020
    Posts:
    3
    krisventure likes this.
  5. xdprint

    xdprint

    Joined:
    May 29, 2019
    Posts:
    8
    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
     
  6. xdprint

    xdprint

    Joined:
    May 29, 2019
    Posts:
    8
    I found a bug. In the parameter I used a gameId of type "parameter", not a string. screenshot.png

    But now, I get the same error:
    No fill for placement mainBanner 
    :)
     
  7. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    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 :)
     
  8. Winthir

    Winthir

    Joined:
    Aug 23, 2020
    Posts:
    1
    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:

    Code (CSharp):
    1. private void Start()
    2.     {
    3.         debugPanel = GameObject.Find("Debug Panel");
    4.         Advertisement.AddListener(this);
    5.  
    6.         if (Application.platform == RuntimePlatform.IPhonePlayer)
    7.         {
    8.             isTargetPlayStore = false;
    9.         }
    10.         else if (Application.platform == RuntimePlatform.Android)
    11.         {
    12.             isTargetPlayStore = true;
    13.         }
    14.         InitializeAdvertisement();
    15.     }
    Code (CSharp):
    1.     private void InitializeAdvertisement()
    2.     {
    3.         if (!isTargetPlayStore)
    4.         {
    5.             Advertisement.Initialize(appStoreID);
    6.             return;
    7.         }
    8.         Advertisement.Initialize(playStoreID);
    9.     }
    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:
    upload_2020-8-23_10-35-24.png

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


    Thanks for your support!
    Winthir
     
  9. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,026
    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 to check true connection before initializing Unity Ads.

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

    Environment:
    • Unity Ads 3.6.1
    • Unity 2019.4.18
    • iOS 14.4
    • iPhone XS Max
     
  10. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Hey @makaka-org could you post a full device log of the error you are seeing?
     
  11. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,026
    sent in conversation. Is it related with this bug?
     
  12. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    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!
     
    makaka-org likes this.
  13. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Update: looks like the team is already aware of this and it should be fixed today!
     
    makaka-org likes this.
  14. NHSEVEN

    NHSEVEN

    Joined:
    Mar 29, 2021
    Posts:
    1


    Unity Ads SDK fail to initialize due to configuration error
     
Thread Status:
Not open for further replies.