Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    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:
    142
    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:
    142
    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:
    142
    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:
    2
    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:
    48
    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:
    7
    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:
    142
    @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.
     
unityunity