Search Unity

Unity 2017.1 Unity's Ad UI not working in Editor

Discussion in 'Unity Ads & User Acquisition' started by bitjunk, Jul 26, 2017.

  1. bitjunk

    bitjunk

    Joined:
    May 19, 2017
    Posts:
    16
    I have my project set to an Android platform build and the Unity's Ad UI window that usually shows in the editor is not working correctly. However when I compile and run the game on my phone the Ad video does seem to work correctly. I keep getting an error initializing unity ad's in the editor. Is there any known bugs with Unity's advertisement system using Unity version 2017.1.0f3
     
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Not that we're aware of at least. We're using Unity 2017.1 for developing our own games and our usual automation is running on 2017.1 as well. What error do you get during initialization?

    /Rasmus
     
  3. bitjunk

    bitjunk

    Joined:
    May 19, 2017
    Posts:
    16
    Below is the error message. I'm using Unity 2017.10.f3.

    NullReferenceException: Object reference not set to an instance of an object
    System.Net.AutoWebProxyScriptEngine.InitializeRegistryGlobalProxy () (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.AutoWebProxyScriptEngine.GetWebProxyData () (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.WebProxy.UnsafeUpdateFromRegistry () (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.WebProxy..ctor (System.Boolean enableAutoproxy) (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.WebProxy.CreateDefaultProxy () (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.Configuration.DefaultProxySectionInternal.GetSystemWebProxy () (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.Configuration.DefaultProxySectionInternal.GetDefaultProxy_UsingOldMonoCode () (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.Configuration.DefaultProxySectionInternal.GetSection () (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.WebRequest.get_InternalDefaultWebProxy () (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.HttpWebRequest..ctor (System.Uri uri) (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    (wrapper remoting-invoke-with-check) System.Net.HttpWebRequest:.ctor (System.Uri)
    System.Net.HttpRequestCreator.Create (System.Uri uri) (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.WebRequest.Create (System.Uri requestUri, System.Boolean useUriBase) (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    System.Net.WebRequest.Create (System.String requestUriString) (at <f044fe2c9e7e4b8e91984b41f0cf0b04>:0)
    UnityEngine.Advertisements.Editor.Platform.Initialize (System.String gameId, System.Boolean testMode) (at C:/buildslave/unity/build/Extensions/UnityAds/UnityAds/Editor/Platform.cs:89)
    UnityEngine.Advertisements.Advertisement.Initialize (System.String gameId, System.Boolean testMode) (at C:/buildslave/unity/build/Extensions/UnityAds/UnityAds/Advertisement.cs:229)
    UnityEngine.Advertisements.Advertisement.Load () (at C:/buildslave/unity/build/Extensions/UnityAds/UnityAds/Advertisement.cs:73)
    UnityEngine.Advertisements.Advertisement.LoadEditor (System.String extensionPath, System.Boolean supportedPlatform) (at C:/buildslave/unity/build/Extensions/UnityAds/UnityAds/Advertisement.cs:65)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:305)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:313)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229)
    UnityEditor.Advertisements.UnityAdsEditor.EditorOnLoad () (at C:/buildslave/unity/build/Extensions/UnityAds/UnityAdsEditor/UnityAdsEditor.cs:29)
     
  4. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    We had a similar issue a long time ago (Unity 5.3) when game id was null, but that should have been fixed.

    You can check ProjectSettings/UnityConnectSettings.asset if game ids are set (remember to change serialization to text in Edit->Project Settings->Editor menu) or if you can somehow share project, you are welcome to send me a PM with info.

    Thanks,
    Rasmus
     
  5. bitjunk

    bitjunk

    Joined:
    May 19, 2017
    Posts:
    16
    Error fixed for now. I previously changed Scripting Runtime Version to "Experimental (.NET 4.6 Equivalent)" under the PlayerSettings -> Other Settings -> Configure Section . I changed it back to "Stable (.NET 3.5 Equivalent)" and fixed the error. So long story short keep Scripting Runtime Version option set to "Stable (.NET 3.5 Equivalent)" for now.
     
  6. Pratik_Meshram

    Pratik_Meshram

    Joined:
    Jul 23, 2018
    Posts:
    1
    i am getting this exact error with unity2019.3.0f6
    with intialzing the unity ads i get this error
    now there is no scripting runtime version setting in other settings
    there is only Api compatabilty level
    but changing that also doesnt remove the error
    help!!!
     
    Rithikgames likes this.
  7. Rithikgames

    Rithikgames

    Joined:
    May 21, 2017
    Posts:
    1
    ya mee too! i am facing the same problem with unity2019.3.6f1!
    please help me ..
     
  8. DrMethod

    DrMethod

    Joined:
    Jan 15, 2020
    Posts:
    36
    #meToo

    wtf oO 2019.3.0f6
     
  9. taranasus

    taranasus

    Joined:
    Jan 16, 2015
    Posts:
    3
    Hi all,

    Since nobody seems to be linking to the problem, I will. It's actually an underlying bug in the mono framework: https://github.com/mono/mono/issues/10030

    I'm having the same issue in custom code in my game to do Http Web requests:

    Code (CSharp):
    1.        var request = (HttpWebRequest)WebRequest.Create(url);
    2.                 request.Timeout = (i + 1) * 10000;
    3.                 var response = (HttpWebResponse)request.GetResponse();
    I'm still trying to find a way to fix it in-code so the users don't have to do anything, but the problem lies in the fact that they have enabled a proxy in windows without actually configuring a url to a proxy.

    The user-side fix is simple:
    upload_2020-10-24_20-36-17.png

    Just turn that off and you're golden!