Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Problems with mediation initialization in build

Discussion in 'Unity Mediation' started by adespawn, Mar 10, 2022.

  1. adespawn

    adespawn

    Joined:
    Nov 2, 2020
    Posts:
    1
    I have created new project and followed instruction to setup mediation ads. I successfully created project in unity dashboard. I also enabled ads, and got both android and ios game IDs
    upload_2022-3-10_20-45-34.png

    In game editor, using mediation code generator, implemented interstitial ads. When testing in play mode everything works fine (test ad loads). But when trying to run it on android phone (trough build and run feature, with connected phone selected as run device), mediation initialization fails (rest of the game works fine). In android logcat console i get the following error
    Error logger Initialization has failed due to: Request to https://mediation-instantiation.prd.mz.internal.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: 4xxxxxx


    And, when trying to load ad in the same console i get following error:
    https://pastebin.com/QtgU4ETf
     
  2. Mark_

    Mark_

    Joined:
    Dec 6, 2012
    Posts:
    2
    I have the same issue - initialization error about game id not found. The id is correct so I'm not sure what I've missed and I've already gone through the integration documentation several times.
    I've tested mediation SDK version 0.4.0-preview 1 and 2.
     
  3. unity_slamo

    unity_slamo

    Unity Technologies

    Joined:
    Oct 14, 2021
    Posts:
    1
    Hi adespawn and Mark_, thank you for bringing this to the team's attention. After some investigation we identified and resolved the problem. We have verified that both of you should no longer be seeing these errors. Please try again and reach out if the problem persists.
     
  4. Mark_

    Mark_

    Joined:
    Dec 6, 2012
    Posts:
    2
    I can confirm that mediation is initializing correctly and ads are showing without any changes. Thank you.
     
    jcGrenier and unity_slamo like this.
  5. Andres_Murman

    Andres_Murman

    Joined:
    Apr 29, 2020
    Posts:
    5
  6. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hello @Andres_Murman,

    Could you confirm that the Game ID you are using in your code coincides with the Game ID you have in your dashboard (Monetization > Project Overview > Settings > Game IDs section) ?

    Thanks for sharing this issue with us!
     
    Last edited: May 22, 2022
  7. Andres_Murman

    Andres_Murman

    Joined:
    Apr 29, 2020
    Posts:
    5
    Yes, checked it, Android Game Id is 4753597
     
  8. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hey @Andres_Murman,

    I tested your Android Game Id and I was able to successfully initialize. Here are a few things worth checking:

    In your Unity Editor, check that your project is correctly configured to automatically fetch your Game Id, here's a link to the troubleshooting guide.

    You can also force a specific Game Id by using this interface, ideal for such troubleshooting scenarios.

    Let us know if that works for you, thanks!
     
  9. Andres_Murman

    Andres_Murman

    Joined:
    Apr 29, 2020
    Posts:
    5
    Thanks @DeclanMcPartlin, i've done all that already, but will try it again to make sure i didnt miss anything. I'll let you know if I was able to make it work.
     
  10. Andres_Murman

    Andres_Murman

    Joined:
    Apr 29, 2020
    Posts:
    5
    @DeclanMcPartlin, now its working. Its strange, I didnt change anything, just rebuild and redeploy to phone. Thanks for your help.
     
  11. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hey @Andres_Murman,

    I'm glad to hear it is working for you now. Generally it should work right after creating the project, but sometimes it can take a few minutes.

    Thanks again for sharing your issue, much appreciated.
     
  12. JohnKoum

    JohnKoum

    Joined:
    Nov 19, 2021
    Posts:
    3
    Hello I just installed Unity mediation. After following all the steps and configuration settings I tried to test it on my Android device but the initialization is failing. Here is what I get as an error:

    Initialization Failed: System.AggregateException: One or more errors occurred. ---> Unity.Services.Core.ServicesInitializationException: Request to https://mediation-instantiation.prd.mz.internal.unity3d.com/v1/initialize failed due to java.net.ConnectException: Failed to connect to mediation-instantiation.prd.mz.internal.unity3d.com/0.0.0.0:443 ---> Unity.Services.Mediation.InitializeFailedException: Request to https://mediation-instantiation.prd.mz.internal.unity3d.com/v1/initialize failed due to java.net.ConnectException: Failed to connect to mediation-instantiation.prd.mz.internal.unity3d.com/0.0.0.0:443
     
  13. ExcaliburGames

    ExcaliburGames

    Joined:
    Oct 29, 2013
    Posts:
    50
    Hi

    we got a lot of this errors:
    Unable to resolve host "mediation-instantiation.unityads.unity3d.com": No address associated with hostname at Ads.UnityMediationRewarded.OnRequestStart ()

    Unity 2021.3.2
    Mediation package: 0.5.1-preview.1



    full error log:
    Unity.Services.Mediation.LoadFailedException: Exception raised while retrieving the Ad Unit Configuration: com.unity3d.mediation.h0: Failed to fetch Ad Unit due to connectivity issues: Request to https://mediation-instantiation.unityads.unity3d.com/v1/waterfall failed due to java.net.UnknownHostException: Unable to resolve host "mediation-instantiation.unityads.unity3d.com": No address associated with hostname at Ads.UnityMediationRewarded.OnRequestStart () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task& currentTask) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run (System.Threading.Tasks.Task ignored, System.Boolean canInlineContinuationTask) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.Task.FinishContinuations () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.Task.TrySetException (System.Object exceptionObject) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.TaskCompletionSource`1[TResult].TrySetException (System.Exception exception) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.TaskCompletionSource`1[TResult].SetException (System.Exception exception) [0x00000] in <00000000000000000000000000000000>:0 at Unity.Services.Mediation.RewardedAd.OnLoadFailed (System.Object sender, Unity.Services.Mediation.LoadErrorEventArgs args) [0x00000] in <00000000000000000000000000000000>:0 at Unity.Services.Mediation.Platform.AndroidRewardedAdLoadListener+<>c__DisplayClass3_0.<onRewardedFailedLoad>b__0 (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext.Exec () [0x00000] in <00000000000000000000000000000000>:0
     
  14. toan-stt

    toan-stt

    Joined:
    Sep 30, 2013
    Posts:
    11
    Today, I update my advertisement to unity advertisement with mediation, and I got this error:
    I double-checked the game id and ad unit id, they both correct.
    Can you help me

    2022/10/31 21:36:05.467 9549 9581 Info Unity NetworkError:Exception raised while retrieving the Ad Unit Configuration: com.unity3d.mediation.j0: Failed to fetch Ad Unit due to connectivity issues: Request to https://mediation-instantiation.unityads.unity3d.com/v1/waterfall failed due to java.io.IOException: Instantiation Service configuration request failed with http status code 404 and server response: ad unit configuration not found for game id: 1xxxxxx, ad unit id: rewardedVideo
     
  15. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    @toan-stt, feel free to send me the game id and ad unit id in a PM, although this might just come down to issues with the device's internet connection.
     
  16. watermelonlab

    watermelonlab

    Joined:
    Sep 17, 2015
    Posts:
    15
    Did you find any solution I am also getting sometime connectivity issue sometime get ad unit has incorrect format.
    Some time it is working with one game id but not with other . I am really frustrate. Help me.
     
  17. CHS_Paul

    CHS_Paul

    Joined:
    Aug 4, 2022
    Posts:
    2
    Hi, I am facing the same problem, can you please help me to test it? I don't know where it goes wrong.. Thank you!
    Inner: System.AggregateException: One or more errors occurred. (Request to https://mediation-instantiation.unityads.unity3d.com/v1/initialize has failed with status code 404 and server response game init not found for game id: 5070506
    ) ---> Unity.Services.Core.ServicesInitializationException: Request to https://mediation-instantiation.unityads.unity3d.com/v1/initialize has failed with status code 404 and server response game init not found for game id: 5070506
    ---> Unity.Services.Mediation.InitializeFailedException: Request to https://mediation-instantiation.unityads.unity3d.com/v1/initialize has failed with status code 404 and server response game init not found for game id: 5070506
     
    javierron90 likes this.
  18. javierron90

    javierron90

    Joined:
    Feb 1, 2020
    Posts:
    3
    I have the same error as the original post:
    "java.io.IOException: Instantiation Service initialization request failed with http status code 404 and server response: game init not found for game id: 5XXXXX"

    @DeclanMcPartlin Any help? Thanks!
     
    Last edited: Dec 31, 2022
  19. koshelev_unity

    koshelev_unity

    Joined:
    Mar 11, 2019
    Posts:
    5
    I have the same error. I solved the problem by switching my project to Mediation in Unity console. But finding this button was very difficult, and I still don't know how I did it. This screen looked like "About" but instead of "Service enabled" there was a button "Switch to Mediation"
     

    Attached Files:

    DeclanMcPartlin likes this.
  20. Professor45

    Professor45

    Joined:
    Dec 31, 2019
    Posts:
    3
    Hi, I am new in unity and using unity mediation for the first time, I integrate the unity mediation with Meta Audience Network, everything going well my game showing ads, the ads impression counting properly on the unity dashboard, but the problem i am facing is that my Meta audiance network is not counting the impressions, only the ads requests is counting.
    I am sharing some screenshots for better understanding. 1.PNG 2.PNG 3.PNG

    I was contected to Meta Custommer support but they have no idea. they mailed me "Check your code to make sure onLoggingImpression() is called after the ad is displayed."
    I Dont have any idea what does it mean.
    Please if anyone have any idea or faced the same issue before please help me.
    And sorry for the bad english
     
  21. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    146
    Hey @shahfahadkhan987,

    This isn't in context with this thread, please create a new thread or look for a thread with the same issue - thanks!
     
  22. jpom001

    jpom001

    Joined:
    Dec 3, 2020
    Posts:
    69
    Hi, I'm getting this issue now as well. I'm seeing ads in unity editor but not on my device. I've set my device as a test device and Im forcing test from the mediation ui as well. Is this an issue with my game id as well? It seems to be correct according to the website?
    Code (CSharp):
    1. Initialization has failed due to: 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: 5116789
    2. 01-11 22:57:02.730 22580 22617 I Unity   : Initialization Failed: Unknown:Some services couldn't be initialized. Look at inner exceptions to get more information.
    3. 01-11 22:57:45.349 22580 22580 W Unity   : Timeout while trying detaching primary window.
    Edit:
    I do notice that although I have my gameid set in my sample code, I'm not seeing that reflected here although my project seems like its linked correctly, is this an issue. I'm using. Im using 2022.1.17

    upload_2023-1-12_8-27-9.png
     
    Last edited: Jan 12, 2023
  23. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    As per our discussion on another thread, I believe you may not have a Unity Mediation project created on the dashboard, as it should no longer be possible to create a new one. It would explain issues getting access to the project informations.
     
  24. Librosdigitale

    Librosdigitale

    Joined:
    Dec 18, 2022
    Posts:
    3
    I have the very same error for all projects I Created in December 2022. Please give me a solution.

    I am getting this log:

    E/logger: Initialization has failed due to: 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: 5087867
     

    Attached Files:

  25. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    This suggests you are using the Unity Mediation package, while your project on the dashboard is setup to use LevelPlay mediation.
    Please remove the Advertisement with Mediation package, and install the Ads Mediation package instead.
     
  26. Librosdigitale

    Librosdigitale

    Joined:
    Dec 18, 2022
    Posts:
    3
    In my App am using
    mediation-sdk:1.0.0
    and unityads-adapter:1.0.1
     
  27. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    @Librosdigitale these are from Unity Mediation, aka Advertisement with Mediation
     
  28. Librosdigitale

    Librosdigitale

    Joined:
    Dec 18, 2022
    Posts:
    3
    What should I do? Because other projects are using the same integration method and ads are showing from Unity, Admob and Meta with no problem.
     
  29. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Please remove the Advertisement with Mediation package, and install the Ads Mediation package instead.
     
  30. unity_EC2A29069B618BF20268

    unity_EC2A29069B618BF20268

    Joined:
    Jun 29, 2022
    Posts:
    1
  31. D_Sol

    D_Sol

    Joined:
    Mar 6, 2020
    Posts:
    2
    Hi, I'm also getting the same error:
    Code (CSharp):
    1. Unity.Services.Core.ServicesInitializationException: 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: 506XXXX ---> 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 s
    These are my configurations:
    • Unity Editor Version: 2021.3.21f1.git.1774945 Personal
    • IronSource Adapter Version: 7.3.0.1
    • UnityAds: 4.3.32.0
    • Advertisement with Mediation Version: 1.0.5
    • Ads Mediation: 1.0.0
    • Advertisement Legacy: Not Installed
    On the Unity Dashboard in Monetization > Project Overview > Settings > Game IDs section, my Android GameId matches the GameId reported in the exception received at runtime on the Android device. Also, on the Dashboard, the project is set to use Unity (not mediated) and not LevelPlay mediation.

    In the code, I set the GameId manually as follows:
    Code (CSharp):
    1. await UnityServices.InitializeAsync(GetGameId());
    2. ...
    3. InitializationOptions GetGameId()
    4. {
    5. var initializationOptions = new InitializationOptions();
    6.  
    7. #if UNITY_IOS
    8. if (!string.IsNullOrEmpty(_iOSGameId))
    9. {
    10. initializationOptions.SetGameId(_iOSGameId);
    11. }
    12. #elif UNITY_ANDROID
    13. if (!string.IsNullOrEmpty(_androidGameId))
    14. {
    15. initializationOptions.SetGameId(_androidGameId);
    16. }
    17. #endif
    18.  
    19.     return initializationOptions;
    20. }

    Until a few days ago, I was using Advertisement Legacy and therefore using the IUnityAdsInitializationListener, IUnityAdsLoadListener, IUnityAdsShowListener, and their respective initialization, loading, and showing methods.
    Using the same GameId that now generates the error, I was able to display the ads.

    Honestly, I've followed all the guides and I can't find a possible error. Can anyone tell me what's wrong, or what else I can check or modify? Thank you.
     
  32. ooxcit

    ooxcit

    Joined:
    Jul 7, 2021
    Posts:
    26
    We have this error, only on some devices, that device doesn't have advertisment id if it helps:

    InitializeFailedException: Request to https://mediation-instantiation.unityads.unity3d.com/v1/initi

    Rethrow as ServicesInitializationException: Request to https://mediation-instantiation.unityads.unity3d.com/v1/initialize failed due to java.net.ConnectException: Failed to connect to mediation-instantiation.unityads.unity3d.com/0.0.0.0:443
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <00000000000000000000000000000000>:0)
    Unity.Services.Mediation.MediationServiceInitializer+<Initialize>d__4.MoveNext () (at <00000000000000000000000000000000>:0)
    System.Threading.ContextCallback.Invoke (System.Object state) (at <00000000000000000000000000000000>:0)
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
    System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at <00000000000000000000000000000000>:0)
    System.Action.Invoke () (at <00000000000000000000000000000000>:0)
    System.Threading.ContextCallback.Invoke (System.Object state) (at <00000000000000000000000000000000>:0)
    System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task& currentTask) (at <00000000000000000000000000000000>:0)
    System.Threading.Tasks.Task.FinishContinuations () (at <00000000000000000000000000000000>:0)
    System.Threading.Tasks.Task.Finish (System.Boolean bUserDelegateExecuted) (at <00000000000000000000
     
  33. Hasib135

    Hasib135

    Joined:
    Apr 18, 2017
    Posts:
    1
    I have the same issue, in the android studio can anyone help me?

    Unity Ads failed to load ad : Interstitial_Android : error : 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: 5436023