Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Ads initialize error

Discussion in 'Unity Ads' started by kilicbatuhan1205, Feb 19, 2020.

  1. kilicbatuhan1205

    kilicbatuhan1205

    Joined:
    Dec 20, 2018
    Posts:
    23
    Hey guys,

    I am getting following error on (and ONLY on) Nexus 5X on Google Pre-Launch-Report:
    Code (csharp):
    1. AndroidJavaException: java.lang.NullPointerException: Attempt to invoke interface method 'void com.unity3d.ads.IUnityAdsListener.onUnityAdsError(com.unity3d.ads.UnityAds$UnityAdsError, java.lang.String)' on a null object reference
    My code for initializing Unity Ads:
    Code (csharp):
    1. public void Initialize()
    2. {
    3.     Advertisement.AddListener(this);
    4.     Advertisement.Initialize(gameId, testMode);
    5. }
    This class inherits IUnityAdsListener, so that's not the problem.
    I'm using Unity Ads 3.4.2 and Unity 2018.4.17f1 LTS.

    Can anyone help?
     
  2. kilicbatuhan1205

    kilicbatuhan1205

    Joined:
    Dec 20, 2018
    Posts:
    23
    And the listener is also not being added twice.
     
  3. MichiealO

    MichiealO

    Joined:
    Jul 7, 2013
    Posts:
    68
    I'm having the same issue. And, somehow it got released into Production... >.<
     
unityunity