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

[Solved] Initializing Unity Ads Errors

Discussion in 'Unity Ads & User Acquisition' started by Blaze5565, Jan 9, 2019.

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

    Blaze5565

    Joined:
    Sep 11, 2018
    Posts:
    11
    Hi,

    I suddenly started getting errors in my game yesterday. I've managed to fix most of them, but I can't find much on the last two that I'm getting now.

    Initializing Unity Ads.
    UnityEngine.Advertisements.Creator:LoadRuntime()



    InvalidCastException: Specified cast is not valid.
    UnityEngine.Advertisements.Creator.CreatePlatform () (at <2a095cd4bec246c295780cb64ddeb6c7>:0)
    UnityEngine.Advertisements.Creator:LoadRuntime()

    Both of them are the red exclamation mark errors. I'm building to Android currently, so that shouldn't be the problem. I've also already tried re-importing all assets.

    Any help would be much appreciated.
     
  2. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    Hi,

    Can you provide some more details:
    - Your integration path (Asset Store? Services window?)
    - Your Unity version
     
  3. Blaze5565

    Blaze5565

    Joined:
    Sep 11, 2018
    Posts:
    11
    Um, both? I installed via the asset store, but it says on in the services tab too. But it's been like that before I got any bugs or anything.
    Unity version is 2018.3.0f2, but I initially started the project in 2018.2.xx (can't remember). It was also initially working after updating to 2018.3.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please share the code that you are using.
     
  5. mikaisomaa

    mikaisomaa

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    365
    Use only one integration - I recommend disabling the services window -integration and testing again.

    In later versions - there's also the package manager to take into account. Make sure Ads isn't included through the package manager as well when integrating the Asset Store package. You can do this from the package manager window or by manually editing the manifest.json -file:

    https://docs.unity3d.com/Packages/com.unity.package-manager-ui@1.7/manual/index.html

    Let me know if this helps.
     
    Blaze5565 likes this.
  6. Blaze5565

    Blaze5565

    Joined:
    Sep 11, 2018
    Posts:
    11
    I disabled the services window and package manager versions, and now it's working fine. Thank you!
     
Thread Status:
Not open for further replies.