When you integrate LevelPlay with the Unity Editor you might experience some problems. Use this guide to troubleshoot the following types of issues:
- Duplicated classes error message
- Scripting Symbol can't be removed from the ironSource SDK
- Missing dependency class error message
Specifying Banner ad position with LevelPlayBannerPosition
Error
If you encounter a compile error when using LevelPlayBannerPosition
as an enum or integer, this is because LevelPlayBannerPosition
has been updated from an enum to a class in version 8.8.0. This change affects how banner positions should be referenced in code.
Resolution
In LevelPlay Unity package versions 8.8.0 and 8.8.1, LevelPlayBannerPosition
was changed from an enum to a class. The updated API supports nine predefined banner positions and allows you to specify an exact (x,y) coordinate by creating a LevelPlayBannerPosition
object.
If you see LevelPlayBannerPosition
compile errors in the Unity Editor Console, refer to the following examples to understand some possible causes and how to resolve them:
Example 1: Parameter default value error
You might see a compile error when passing LevelPlayBannerPosition
as a parameter with a default enum value. To fix this, use null instead:
// Use null for the default value, or pass a value explicitly public LevelPlayBannerAd(string adUnitId, LevelPlayBannerPosition position = null)
Example 2: Invalid switch or enum comparisons
You might see a compile error if your code uses a switch statement or compares LevelPlayBannerPosition
values as enums or integers. For example:
switch (position) { case LevelPlayBannerPosition.BottomCenter: }
Since LevelPlayBannerPosition
is now a class, replace this logic with direct object comparisons:
if (position == LevelPlayBannerPosition.BottomCenter) { /* Handle case */ }
You can also use the Description
property to compare banner positions when needed for layout logic, logging, or analytics purposes. For example:
if (position.Description == "BottomCenter") { Debug.Log("Banner is at bottom-center."); }
Duplicated classes error message
You receive duplicated class error message CSO433 when trying to build or test your project. This error message will identify the class that has been duplicated and which assemblies it appears in. The following is an example of a duplicated class error message:
- The type
IronSourceMediationSettings
exists in bothAssembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
and'Unity.LevelPlay, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
The duplicated classes error has the following possible causes:
- Updating the Ads Mediation package without removing the Unity Plugin
- Updating the Unity Plugin without removing the Ads Mediation package
- Significant Ads Mediation package updates
Refer to the following sections for descriptions and resolutions of these issues.
Updated the Ads Mediation package without removing the Unity Plugin
You updated to the latest version of Unity LevelPlay through the Ads Mediation package when the .unitypackage file (the Unity Plugin) was already installed.
Resolution
Remove the .unitypackage file (the Unity Plugin) before installing or updating the Ads Mediation package. To remove the plugin, complete the following steps:
- Open your project in the Unity Editor and go to Assets.
- From Assets, do one of the following depending on what version of the IronSource SDK you're using:
- SDK v7.8.0 and earlier: Right-click IronSource > Delete.
- SDK v8.0.0: Right-click LevelPlay > Delete.
Updated the Unity Plugin without removing the Ads Mediation package
You updated to the latest version of Unity LevelPlay through the .unitypackage file when Ads Mediation was already installed.
Resolution
Remove the Ads Mediation package before installing or updating the Unity Plugin. Use the following steps to remove the Ads Mediation package from the Unity Editor:
- Open your project in the Unity Editor and go to Window > Package Manager.
- In the Package Manager, select Packages > In Project.
- Select Ads Mediation > Remove.
- From your Project in the Unity Editor, go to Assets.
- From Assets, do one of the following depending on what version of the ironSource SDK you're using:
- SDK v7.8.0 and earlier: Right-click IronSource > Delete.
- SDK v8.0.0: Right-click LevelPlay > Delete.
- If installed, right-click Mobile Dependency Resolver > Delete as well.
Significant Ads Mediation package updates
You updated the Ads Mediation package from an early version to a much later version.
Resolution
If your Ads Mediation package is in need of significant updates, you might need additional steps to ensure a smooth upgrade path.
For example, if you are updating from v1.0.0 to v8.0.0, you'll need to take additional steps when updating. For more information, refer to the Ads Mediation package description in the Unity Package Manager.
Scripting Symbol can't be removed from the ironSource SDK
You removed the LEVELPLAY_DEPENDENCIES_INSTALLED
scripting symbol from the ironSource SDK, but it keeps automatically reappearing in the SDK.
Cause
When you remove the LEVELPLAY_DEPENDENCIES_INSTALLED
scripting symbol from the SDK, the SDK will always re-add it automatically. As of version 8.0.0 of the ironSource SDK Unity Package, this scripting symbol is required.
Resolution
This issue has no known solution because the scripting symbol is required for the ironSource SDK as of version 8.0.0. The symbol will always be re-added automatically if deleted.
Missing dependency class error message
You received a dependency class error message after installing the Ads Mediation package. The following messages are examples of possible missing dependency class warnings:
- The type or namespace name
Core
does not exist in the namespaceUnity.Services
. - The type or namespace name
Newtonsoft
could not be found. - The type or namespace name
EditorGameServiceFlagEnabler
could not be found.
Cause
This can happen if the com.unity.services.core
dependency from the ironSource SDK Unity package is removed or fails to install. If this dependency is missing, the console displays an error message identifying which dependency classes couldn't be found.
Resolution
There are two ways to resolve the missing com.unity.services.core
dependency: by installing the Services Core package manually by name or by removing the LEVELPLAY_DEPENDENCIES_INSTALLED
scripting symbol.
Install the Services Core package in Package Manager
To resolve the missing dependency, install the Services Core package in the Unity Package Manager by doing the following:
- Open your project in the Unity Editor and go to Window > Package Manager.
- In the Package Manager window, select the + icon to open the dropdown menu and select Install package by name... to enter the package name manually.
- Enter
com.unity.services.core
in the Name field and select Install.
Remove the LEVELPLAY_DEPENDENCIES_INSTALLED scripting symbol
You can also restore the Services Core package using the LEVELPLAY_DEPENDENCIES_INSTALLED
scripting symbol. When removed, the scripting symbol is re-added automatically. As part of the re-installation process, the com.unity.services.core
package is also reinstalled automatically. You can use this method if the editor doesn't display the services core package.
To resolve the missing dependency, delete the LEVELPLAY_DEPENDENCIES_INSTALLED
scripting symbol from the ironSource SDK Unity package, by doing the following:
- Open your project in the Unity Editor and go to Edit > Project Settings > Player.
- In the Other Settings panel, scroll down to Script Compilation.
- Select the minus symbol (−) to remove a symbol, and select LEVELPLAY_DEPENDENCIES_INSTALLED.
- Select Apply to save your changes.