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

Bug Ads Mediation (LevelPlay) package overwrites Assembly-CSharp-Editor.csproj and breaks project

Discussion in 'LevelPlay' started by BTStone, Sep 12, 2023.

  1. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,418
    Hello Support,

    using Unity 2021.3.25f1

    I am confused how to setup LevelPlay. I am on a project which uses Unity Ads and the Advertisement Legacy package and now the team wants to migrate to LevelPlay.

    Now I read through the docs and forums and I read conflicting stuff.
    In the forums Unity tells us to use the Ads Mediation package from the package manager. But the official ironsource/LevelPlay docs tell us to download and install the irounsource SDK which essentially is a .unitypackage file (not a package from the Package Manager)

    What I did first was this:

    - I did NOT uninstall the Advertisement Legacy package
    - installed the Ads Mediation package from the Package Manager

    Doing this breaks the project, I get a lot of errors stating that the type/namespace could not be found from only scripts which are located in my Editor folder. I found a topic for this but sadly the user couldnt fix it:

    https://forum.unity.com/threads/installing-ads-mediation-ironsource-breaks-project.1398067/

    When I remove the package the errors are gone, and when I try to re-install it they reappear and still break the project.

    Now at the end of that topic I linked above a user writes this

    " I can confirm the same issue. The AdsMediation package is the direct cause of the issue. It modifies the project solution file in such a way that the Editor project (Assembly-CSharp-Editor) is removed from solution! "

    And I can confirm that. For some reason the installation of the AdsMediation package overwrites the Assembly-CSharp-Editor.csproj file, I made a screenshot from winmerge, on the left how it looks before the package installation on the right after the installation of the package:

    EditorChanges.png


    Some of the entries get overwritten for some reason, this seems to be a bug and should not happen.

    Now I did have a look at the actual Ads Mediation package in the Unity Project and saw that there is basically one .unitypackage file, the IronSource_IntegrationManager.unitypackage, the asmdef files and a C# Script "LevelPlayInstaller" and apparently what happens on import is that the LevelPlayInstaller script is executed which itself calls AssetDatabase.ImportPackage and imports the .unitypackage file

    As I mentioned in the beginning the official irounSource/LevelPlay docs say you should install the SDK which is available as a .unitypackage and it seems that both these .unitypackages, the one you can download from irounSource and the one which gets imported by the Ads Mediation package from the Package Manager, are one and the same. It seems there is only one difference:

    The .unitypackage which comes with the Ads Mediation package also imports three additional files:
    - MobileDependencyResolverInstallerLp.cs
    - MobileDependencyResolverLP.Installer.Editor.api
    - MobileDependencyResolverLP.Installer.Editor.asmdef

    And it seems that these are the reason for the issue, because if I do the following it's fine:

    1) If I download the .unitypackage from the ironsource github: https://github.com/ironsource-mobil...Source_IntegrationManager_v7.5.1.unitypackage
    and import it to the project, the project does not break, no script compilation errors
    2) If I install the Ads Mediation package, extract the IronSource_IntegrationManager.unitypackage from the package folder, uninstall the Ads Mediation package and import the IronSource_IntegrationManager.unitypackage ande exclude the MobileDependencyResolverInstallerLp files, the project does not break, no script compilation errors


    So, the question is:

    Do I actually need the Ads Mediation package from the package Manager at all? I mean in the end its sole purpose is to import the .unitypackage file which I can download and import manually and which does not break my project?
     
  2. yunanhou

    yunanhou

    Unity Technologies

    Joined:
    Feb 23, 2023
    Posts:
    35