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. Dismiss Notice

Unity Ads show failed: Unity Ads is not initialized

Discussion in 'Unity Ads & User Acquisition' started by ragyhassan22, Aug 4, 2020.

  1. ragyhassan22

    ragyhassan22

    Joined:
    Jul 28, 2020
    Posts:
    15
    So i published my alpha test app and unity ads is not working.
    Code (CSharp):
    1. void Start()
    2.     {
    3.         Advertisement.AddListener(this);
    4.         Advertisement.Initialize(Googleid, testMode);
    5.        
    6.     }
    i set testMode to false for the alpha test. is this wrong?
    logs file is attached.
     

    Attached Files:

    • log.txt
      File size:
      35.6 KB
      Views:
      262
  2. sbankhead

    sbankhead

    Unity Technologies

    Joined:
    Jul 27, 2014
    Posts:
    97
    so your error is this ```AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='addListener' signature='(Lcom.unity3d.ads.IUnityAdsListener;)V' in class Lcom.unity3d.ads.UnityAds;```.

    Given this is the first call to the sdk the likely occurrence of this is that your missing the native android library that ships with our sdk. How are you including the sdk, is it via Asset Store or via Package Manager? Are ads working for you in editor play mode?

    Best guess is that you included via asset store and deleted the plugins directory or remove the android aar that our sdk is dependent on. Try re-importing the unitypackage you downloaded. If this is not the case, try providing some more details and I should be able to help you find a resolution.
     
  3. Daahrien

    Daahrien

    Joined:
    Dec 5, 2016
    Posts:
    100
    I'm having the same problem, installed via package manager (Advertisement). Ads work on editor (even banners). JDK/SDK etc seems to be linked right.

    Edit.- Well, Asset Store version seems to work well.
     
    Last edited: Oct 13, 2020