Search Unity

Question Advertisment with Meditation not Showing Test Ads

Discussion in 'Unity Mediation' started by kasimridvan, Nov 3, 2022.

  1. kasimridvan

    kasimridvan

    Joined:
    Aug 12, 2018
    Posts:
    8
    Hi everyone,

    I just upgrade advertisement package to Advertisement with Meditation package. I used sample project scripts. In unity editor everything is OK but when i build on physical android test device i'm getting this log:

    "Initialization Failed: Unknown:Some services couldn't be initialized. Look at inner exceptions to get more information."

    and test ads are not showing on android device.

    I couldn't figure out what it means. I did a google search but couldn't find any results.
    I've already enabled test mode in editor: Services->Ads->Test mode enable

    My unity version: 2019.4.16f1
    Adversitement with Meditation verison: 1.0.4
     
  2. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Hi @kasimridvan ,
    This error is related to the unity services initialization. You can wrap the call to
    Code (CSharp):
    1. UnityServices.InitializeAsync(initializationOptions);
    in a try/catch and see what is the inner exception.

    Don't hesitate if you have other questions :)
     
  3. kasimridvan

    kasimridvan

    Joined:
    Aug 12, 2018
    Posts:
    8
    here is my code. I got referenced from example project

    Code (CSharp):
    1. public async void Initialization()
    2.     {
    3.         try
    4.         {
    5.             Debug.Log("Initializing...");
    6.             await UnityServices.InitializeAsync(GetGameId());
    7.             Debug.Log("Initialized!");
    8.  
    9.             InitializationComplete();
    10.         }
    11.         catch (Exception e)
    12.         {
    13.             InitializationFailed(e);
    14.         }
    15.     }
    16.  
    17.     InitializationOptions GetGameId()
    18.     {
    19.         var initializationOptions = new InitializationOptions();
    20.  
    21. #if UNITY_IOS
    22.                 if (!string.IsNullOrEmpty(iosGameId))
    23.                 {
    24.                     initializationOptions.SetGameId(iosGameId);
    25.                 }
    26. #elif UNITY_ANDROID
    27.         if (!string.IsNullOrEmpty(androidGameId))
    28.         {
    29.             initializationOptions.SetGameId(androidGameId);
    30.         }
    31. #endif
    32.  
    33.         return initializationOptions;
    34.     }
    35.  
    36.  
    37. void InitializationFailed(Exception error)
    38.     {
    39.         var initializationError = SdkInitializationError.Unknown;
    40.         if (error is InitializeFailedException initializeFailedException)
    41.         {
    42.             initializationError = initializeFailedException.initializationError;
    43.         }
    44.  
    45.         Debug.Log($"Initialization Failed: {initializationError}:{error.Message}");
    46.     }
    47.  
    48.        
     
    Last edited: Nov 4, 2022
  4. kasimridvan

    kasimridvan

    Joined:
    Aug 12, 2018
    Posts:
    8
    i tried
    Code (CSharp):
    1. Debug.Log(${error.InnerException}");
    and it returns :
    "Unity.Services.Mediation.InitializeFailedException: Request to https://mediation-instantiation.unityads.unity3d.com/v1/initialize failed due to java.io.IOException: Instantiation Service initialization request failed with http status code 404 and server response: game init not found for game id: *******"

    i just copied my game id from unity dashboard. I checked this id with triple times.

    where am i doing wrong?
     
    Last edited: Nov 4, 2022
  5. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    This looks right.
    Can you give me the name of your project so I can look it up?
     
  6. kasimridvan

    kasimridvan

    Joined:
    Aug 12, 2018
    Posts:
    8
    Project names: AdsPackageTest and TDOS
     
  7. kasimridvan

    kasimridvan

    Joined:
    Aug 12, 2018
    Posts:
    8
    i just change meditation sdk to Advertisment 4.3.0 and it works so that i will not use meditation sdk thnx