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

Resolved Issues with IronSource SDK

Discussion in 'LevelPlay' started by vagelis199, Aug 13, 2023.

  1. vagelis199

    vagelis199

    Joined:
    Jul 27, 2012
    Posts:
    167
    I'm migrating from Unity Mediation to LevelPlay and i cannot make it work

    I'm following this guide https://developers.is.com/ironsource-mobile/unity/unity-plugin/#step-1

    ✅ I removed the Unity Mediation package
    ✅ I downloaded and installed LevelPlay package
    ✅ I setup all the ad networks
    ✅ Added this to android manifest <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
    ✅ Added this to mainTemplate.gradle android.enableDexingArtifactTransform=false
    ✅ Resolved Android dependencies
    ✅ Looked at the sample project code, and implemented the code to my game
    ❌ Tested on the editor, SdkInitializationCompletedEvent() never gets triggered (not sure if its normal behavior)
    ❌ Testing on device i get the following errors:

    Code (CSharp):
    1. setUnityInitializationListener method doesn't exist, error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    2. setUnityRewardedVideoListener method doesn't exist, error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
    3. ... And so on ...
    What am I doing wrong?

    Edit code I used
    Code (CSharp):
    1.   void Start()
    2.     {
    3.        InitStartAds();
    4.     }
    5.  
    6.  
    7.     void OnApplicationPause(bool isPaused)
    8.     {
    9.        IronSource.Agent.onApplicationPause(isPaused);
    10.     }
    11.     void InitStartAds()
    12.     {
    13.  
    14.  
    15.         Debug.Log("Initializing Ads...");
    16.         Status = "Initializing Ads....";
    17.         StatusUI.text = Status;
    18.         IronSource.Agent.init("mygameid");
    19.         IronSourceEvents.onSdkInitializationCompletedEvent += SdkInitializationCompletedEvent;
    20.  
    21.  
    22.     }
    23.     private void SdkInitializationCompletedEvent()
    24.     {
    25.         Debug.Log("Ads Initialized!");
    26.         Status = "Ads Initialized!";
    27.         StatusUI.text = Status;
    28.         Ads_St = true;
    29.  
    30.     }
     
    IgorAherne likes this.
  2. cnguyen_unitylevelplay

    cnguyen_unitylevelplay

    Unity Technologies

    Joined:
    Mar 23, 2023
    Posts:
    66
  3. vagelis199

    vagelis199

    Joined:
    Jul 27, 2012
    Posts:
    167
    I fixed the issue, by deleting the LevelPlay Plugin which by the way I found it here where it says Download Unity Plugin Version 7.4.0
    And installing the Ads Mediation found in the Package Manager. (I also had to restart Unity)
    Then I did a build and initialization worked.