Unity Advertisement Legacy Fails to initialize in Build Java Class Not Found Services Banner

Hello everyone, I am posting here to seek help regarding the Advertisement Legacy package in Unity. I have searched heavily on this issue and the fixes/errors are not specific to me. Banner ads, and now rewarded ads have been implemented in my project, and work in the test mode in the Unity Editor, however when I build, I get errors on Ad Initialization, specifically:
Error | Unity | Initializing Unity Ads.
Error | Unity | (#0-#3) 0x727… (libunity.so) ? 0x0
Error | Unity | (#4-#11) 0x727… (libil2cpp.so) ? 0x0
Error | Unity | (#12-#25) 0x727… (libunity.so) ? 0x0
Error | Unity | (#26) 0x727… etc…
Error | Unity | Java.lang.ClassNotFoundException: com.unity3d.services.banners.IUnityBannerListener
Followed by another 24 similar errors.
Advertisement Legacy version is 4.12.0. Ad/Game IDs are correct and Test Mode is off. I figured I’d try here, finally, before just updating to the newer advertisement system.

This is a known issue… I didn’t observe any solution in multiple posts in Discussions.

Alternative solution:

Unity forces developers to integrate Unity Ads via Unity LevelPlay (New Standard in Unity). The Unity Ads as Unity package will not be updated. It was announced a long time ago.

I guess Legacy Ads 4.12 is the latest bounty is in updating this Unity package that can have bugs.

1 Like

I’m glad it’s not just me. I look forward to trying the new ad system.

Try to clear all ads related stuff in your project manually before installing/ updating the new version. Source.

Hello,

Thank you for bringing this issue up. We’re aware of this issue and investigating it.
Our thought is that this problem comes from a third-party plugin such as EDM4U (External Dependency Manager for Unity).
Can you try to use Custom Main Gradle Template?

1 Like

Hi, there. Thank you for this suggestion, I tried it with banner ads (Had to put them back in) and it did not work. I’m getting the same:

2024/09/12 19:06:29.539 28207 28236 Error Unity java.lang.ClassNotFoundException: com.unity3d.services.banners.IUnityBannerListener

Thanks for checking that.
The following thread could be related and shows a workaround.

I hope this will help you. Our engineering team is still working on this issue, I will keep posting here if I get an update.

1 Like

Are there any updates? I have tried every possible solution but still getting:

Error Unity Initializing Unity Ads.
Error Unity java.lang.ClassNotFoundException: com.unity3d.services.banners.IUnityBannerListener

Even without banner ads I am getting this error. Also any trick solution could help since I am stuck with this for days. I opened a new project and included only Advertisement Legacy sample to test and still this error… Unity version 2022.3.22f1, Advertisement Legacy version 4.12.0.