When I go to build the IronSource DemoScene on a device, so I can test ads. I get a failed build due to the below
It looks to me it is searching for this dependency here :
I cant access that repo, so I’m not sure if its down, I need to request access or the dependency does not exist under that artifact name .
I have found an alternative here:
But changing the Ironsourcesdkdependencies.xml or the mainTemplate.gradle does not work as I think there is other stuff going on forcing it to look in the other repo.
Questions are:
Do I need access or does the dependency exist?
Is there something else wrong with my setup , Ive turned on all of these files to resolve another issue
What went wrong:
Execution failed for task ':launcher:checkDebugDuplicateClasses'.
> Could not resolve all dependencies for configuration ':launcher:debugRuntimeClasspath'.
The project declares repositories, effectively ignoring the repositories you have declared in the settings.
You can figure out how project repositories are declared by configuring your build to fail on project repositories.
See https://docs.gradle.org/7.2/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
> Could not find com.ironsource.sdk:mediationsdk:7.2.6.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/ironsource/sdk/mediationsdk/7.2.6/mediationsdk-7.2.6.pom
- https://repo.maven.apache.org/maven2/com/ironsource/sdk/mediationsdk/7.2.6/mediationsdk-7.2.6.pom
- file:/C:/unityProjects/test1/test2/unityLibrary/libs/mediationsdk-7.2.6.jar
- file:/C:/unityProjects/test1/test2/unityLibrary/libs/mediationsdk.jar
I think your problem is something else, you have multiple mediation sdk libraries in your project. You have aar library in your plugins and you also add the library using gradle dependency, even the gradle error suggest that this is the issue, your first error line is:
Try to remove every ironsource aar, jar and build again. This is the error you will usually get if you have multiple versions or copies of the same library.
I tried that, build and run and got the same error, unless there is somewhere else I should delete these jars from?
I followed this here , https://developers.is.com/ironsource-mobile/unity/unity-plugin/
The only thing I did different was install the a package called “Ads Mediation”, but that was only because the android resolver does not get installed via the steps in the document above. I posted a question on another forum about that.
Im not seeing any errors in the logs and I only have this scene from the ironsourcedemo loading. Any ideas, Id expect to see some ads here or at least the same screen as editor?
Do you have the ironsource scene in your build settings? Check build settings, click on “Add Open Scenes” to add your scene and drag it to the top of the list. You can find more details here: Unity - Manual: Build Settings
Yes I have it added, you can see on my second post a screen shot of my build settings and there are only two scenes. I’ve removed the other one now as well and I still see the blue screen?
You should indeed see a screen similar to what you have in editor. You can check to make sure you included the scene as tduriga suggested, and make sure it is the first one launched. You can also check your logs for errors, or add your own gameObjects and logs to the scene for further debugging.
I deleted my app on the phone rebuilt clean and that worked.
I clicked on one of the buttons and the ads did not load, I got this error in the logs. I suspect something needs to be set on the Ironsource side?
There I’ve created my app and copied my appkey into the code.
Ive added my android phone as a test device and entered the advertiser id from my google settings on my phone.
Ive enabled test mode.
Even after that when I click on the button for the banner and inertial ad, it does not work. I have enabled these ads on IronSource UI. I am now only using the iron source UI, I have not made any changes on the Unity Monetization UI, Im assuming I only use ironsource now?
Autoconnected Player “Autoconnected Player” AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener;
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.-$$Nest$mnativeRender(Unknown Source:0)
at com.unity3d.player.UnityPlayer$C$a.handleMessage(Unknown Source:95)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at com.unity3d.player.UnityPlayer$C.run(Unknown Source:24)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.ironsource.mediationsdk.sdk.InitializationListener” on path: DexPathList[[zip file “/data/app/~~pGkxLu4ZMDXRLMBvash6hw==/com.DefaultCompany.test1–N0OljBQO_Z-5WT7P8aI5Q==/base.apk”],nativeLibraryDirectories=[/data/app/~~pGkxLu4ZMDXRLMBvash6hw==/com.DefaultCompany.test1–N0OljBQO_Z-5WT7P8aI5Q==/lib/arm, /data/app/~~pGkxLu4ZMDXRLMBvash6hw==/com.DefaultCompany.test1–N0OljBQO_Z-5WT7P8aI5Q==/base.apk!/lib/armeabi-v7a, /system/lib, /system_ext/lib, /product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
… 7 more
at UnityEngine.AndroidJNISafe.CheckException () [0x0008d] in /home/bokken/build/output/unity/unity/Modules/AndroidJNI/AndroidJNISafe.cs:24
at UnityEngine.AndroidJNISafe.FindClass (System.String name) [0x0000c] in /home/bokken/build/output/unity/unity/Modules/AndroidJNI/AndroidJNISafe.cs:107
at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) [0x00013] in /home/bokken/build/output/unity/unity/Modules/AndroidJNI/AndroidJava.cs:979
at UnityEngine.AndroidJavaClass…ctor (System.String className) [0x00008] in /home/bokken/build/output/unity/unity/Modules/AndroidJNI/AndroidJava.cs:973
at AndroidAgent.getBridge () [0x0000d] in C:\unityProjects\test1\Assets\IronSource\Scripts\AndroidAgent.cs:25
at AndroidAgent.isInterstitialReady () [0x00001] in C:\unityProjects\test1\Assets\IronSource\Scripts\AndroidAgent.cs:225
at IronSource.isInterstitialReady () [0x00001] in C:\unityProjects\test1\Assets\IronSource\Scripts\IronSource.cs:242
at IronSourceDemoScript.OnGUI () [0x001d4] in C:\unityProjects\test1\Assets\IronSource\DemoScene\IronSourceDemoScript.cs:188
I see other people are having different issues as well with artifacts, is there a happy path you guys have tested on where a particular version of unity works with even the demo project? It does seem that unity apps are currently unable to be monetized with ads, I can create my project on any version, I just need to know what actually works?
I just spent the evening trying to get the demo project working with these instructions
These dont seem to be the complete steps, Im back to the error with
Could not find com.ironsource.sdk:mediationsdk:7.2.7.
And commenting out the mavenlocal and jcenter repos are not fixing the issue this time.
Where should I expect these jars to be once fetched, are they wrapped up in unityLibrary\libs\unity-classes.jar or do they sit along side it here.
This is a new project with just the demo sample in it, its using the mobile 2d template from unity hub, I dont think these instructions are complete.
I solved this issue and got the Demo project working.
In order to do this I had to find my settings.gradle file as per here
I then commented out the dependencyResolutionManagement section
I’m not sure why I need to do this, is it because the demoproject is fetching from a repo that my actual unity project ?
Is this an ok change to make, what would be the repercussions of this for example?
If this is correct or there is some other fix, I think it should be included in the docs as its not obvious from them ( at least to me, unless I’ve missed something, and that could happen!) that I should do this.
It’s a bit hard to figure what your particular issue is from partial data.
The error you are getting java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ironsource/mediationsdk/sdk/InitializationListener; indicates you are missing some of the android libraries.
That particular dependency should be defined in IronSourceSDKDependencies.xml, which should be in your Assets/IronSource/Editor folder.
Depending on your settings, when resolving your dependencies, you should download the library in a plugins folder, or add it to a mainTemplate.gradle file, the entry should look something like implementation 'com.ironsource.sdk:mediationsdk:7.2.6' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9
I do not recommend making manual changes unless you are very familiar with dependency resolution/gradle.
From a blank project, the process should be as follows:
install the package
install a dependency resolver (a popup will offer one if you don’t have one installed)
open the integration manager from the top menu if you want to update to the latest version or install other adapters.
go to your dependency manager menu and resolve your dependencies (and verify that they are there, no error occured etc)
Does this work for you out of the box, these dont seem to be all the steps for me.
I had to add make changes to gradleTemplate.properties file, where the docs dosent call it out as something I need to even generate manually?
When you say blank project, are you using mobile template from unity hub?
These issue seem to be dependecy in nature,
ee https://docs.gradle.org/7.2/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
> Could not find com.ironsource.sdk:mediationsdk:7.2.6.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/ironsource/sdk/mediationsdk/7.2.6/mediationsdk-7.2.6.pom
- https://repo.maven.apache.org/maven2/com/ironsource/sdk/mediationsdk/7.2.6/mediationsdk-7.2.6.pom
- file:/C:/unityProjects/test1/test2/unityLibrary/libs/mediationsdk-7.2.6.jar
- file:/C:/unityProjects/test1/test2/unityLibrary/libs/mediationsdk.jar
Unless Im mistaken, those repos are been overwritten here by default
What Ive done is commented that out, and I think that tells gradle to fetch from the https://android-sdk.is.com/ repo, which as far as I can tell is not been searched in (at least according to the error message).
I wonder is there be some other global place that I may have made a change to unity where it would ignore project repositories for all projects I create?
Thanks for your help.
Can we just have a public solution to this, that does not depend on some support staff changing backend flags?
Test ads work fine on non-live ironsource app. Selecting live app when creating an app makes it unable to fetch ads.
2023/11/21 02:05:11.822 3258 3319 Error ironSourceSDK API: No interstitial configurations found
2023/11/21 02:05:11.832 3258 3319 Error Unity System.Exception: Interstitial - the server response does not contain interstitial data
This is test mode. There should not be some random hidden requirements…