Unity Ads Error

I have had Unity Ads running for sometime on my Andriod device on Google play without issue.

Then they suddenly stopped for no reason.

Desperate to work it out I ended up installing and uninstalling different version to no avail.

I eventually decided to upgrade my project to the latest Editor and Unity Ads.

I am now getting the following logcat results.

2020/12/15 15:28:35.094 4427 4914 Info SurfaceFlinger id=3842 createSurf (0x0),-1 flag=80004, beb452d com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity#0
2020/12/15 15:28:35.106 4427 4914 Info Layer id=3842 removeFromCurrentState beb452d com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity#0 (63)
2020/12/15 15:28:35.110 4427 4914 Info SurfaceFlinger id=3842 Removed beb452d com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity#0 (63)
2020/12/15 15:28:35.121 4427 4427 Info Layer id=3842[1] Destroyed beb452d com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity#0
2020/12/15 15:28:39.694 4918 5536 Verbose WindowManager Relayout Window{1db0463 u0 com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity}: viewVisibility=0 req=1600x720
2020/12/15 15:28:39.696 4427 4427 Info SurfaceFlinger Display 0 HWC layers:
2020/12/15 15:28:39.696 4427 4427 Info SurfaceFlinger type | handle | flag | format | source crop (l,t,r,b) | frame | name
2020/12/15 15:28:39.696 4427 4427 Info SurfaceFlinger ------------±-------------±-----±----------±---------------------------±--------------------±-----
2020/12/15 15:28:39.696 4427 4427 Info SurfaceFlinger DEVICE | 0x7804aa4200 | 0002 | RGBx_8888 | 0.0 0.0 720.0 1600.0 | 0 0 720 1600 | SurfaceView - com.SoloandOulaw.Pitst[…]ayer.UnityPlayerActivity@d0754be@0#0
2020/12/15 15:28:39.696 4427 4427 Info SurfaceFlinger DEVICE | 0x7804aa4c00 | 0000 | RGBA_8888 | 0.0 0.0 1600.0 720.0 | 0 0 720 1600 | com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity$_23186#0
2020/12/15 15:28:39.696 4427 4427 Info SurfaceFlinger
2020/12/15 15:28:39.793 4918 5536 Verbose WindowManager Relayout Window{1db0463 u0 com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity}: viewVisibility=0 req=1600x720
2020/12/15 15:28:39.812 4918 5536 Verbose WindowManager Relayout Window{1db0463 u0 com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity}: viewVisibility=0 req=1600x720
2020/12/15 15:28:39.827 23186 23230 Error Unity java.lang.ClassNotFoundException: com.unity3d.services.banners.IUnityBannerListener
2020/12/15 15:28:39.827 23186 23230 Error Unity UnityEngine.Advertisements.Advertisement:CreatePlatform()
2020/12/15 15:28:39.827 23186 23230 Error Unity UnityEngine.Advertisements.Advertisement:.cctor()
2020/12/15 15:28:39.827 23186 23230 Error Unity AdController:UnityInitialiseAdverts()
2020/12/15 15:28:39.827 23186 23230 Error Unity LoadPreferences:Start()
2020/12/15 15:28:39.827 23186 23230 Error Unity
2020/12/15 15:28:39.827 23186 23230 Error Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2020/12/15 15:28:39.827 23186 23230 Error Unity
2020/12/15 15:29:07.858 4918 4937 Debug WindowManager setSystemUiVisibility: displayId=0, vis=0x3c00971e, fullVis=0x0, dockVis=0x0, win=Window{1db0463 u0 com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity}
2020/12/15 15:29:07.877 4918 4937 Debug WindowManager setSystemUiVisibility: displayId=0, vis=0xc00971e, fullVis=0x0, dockVis=0x0, win=Window{1db0463 u0 com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity}
2020/12/15 15:29:09.421 4918 7204 Verbose WindowManager Changing focus from Window{1db0463 u0 com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity} to null displayId=0 Callers=com.android.server.wm.RootWindowContainer.updateFocusedWindowLocked:202 com.android.server.wm.WindowManagerService.updateFocusedWindowLocked:6195 com.android.server.wm.ActivityDisplay.setFocusedApp:1558 com.android.server.wm.ActivityTaskManagerService.setResumedActivityUncheckLocked:6876 com.android.server.wm.ActivityRecord.moveFocusableActivityToTop:1838 com.android.server.wm.ActivityStack.moveTaskToFrontLocked:5700
2020/12/15 15:29:09.570 5555 7190 Debug RecommendedItemsProvider : (3) [{com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity} / UserHandle{0}, {com.samsung.android.game.gamehome/com.samsung.android.game.gamehome.activity.StartActivity} / UserHandle{0}, {com.instagram.android/com.instagram.mainactivity.MainActivity} / UserHandle{0}]
2020/12/15 15:29:09.570 5555 7190 Debug RecommendedItemsProvider : (3) [{com.SoloandOulaw.Pitstops/com.unity3d.player.UnityPlayerActivity} / UserHandle{0}, {com.samsung.android.game.gamehome/com.samsung.android.game.gamehome.activity.StartActivity} / UserHandle{0}, {com.instagram.android/com.instagram.mainactivity.MainActivity} / UserHandle{0}]

I just don’t seem to be able to get it to work.

I read that you don’t initialize from code now. Is this true?

Can anyone help.

Regards
Steve

I see this in your logs:

2020/12/15 15:28:39.827 23186 23230 Error Unity java.lang.ClassNotFoundException: com.unity3d.services.banners.IUnityBannerListener

We see this sometimes when there are multiple versions of the SDK present in your project. It looks like your app is compiling to Android with an earlier version than what the Unity Editor is using, and so IUnityBannerListener isn’t available.

Remove any ads-related files from your project and then reinstall the Ads SDK using the package manager and this should fix the problem. Otherwise, there could be something else preventing the IUnityBannerListener from being pulled into the Android build.

We do recommend people initialize with code. The latest integration guide can be found here:
https://unityads.unity3d.com/help/unity/integration-guide-unity

1 Like

Thanks for your reply.

Everything looks likes its initialising now on start.

But now it says video is not ready. The correct label has always been used.

2020/12/19 15:21:08.816 1184 1390 Error UnityAds com.unity3d.services.ads.UnityAdsImplementation.handleShowError() (line:265) :: Unity Ads show failed: Placement “video” is not ready

I have tried TEST ads only on live and they are working fine.

It seems to me that something needs to activate the auction process for ad’s to show.

This bug has been going on so long that my stats are all flat out zero.

Could you post the code you are using? Once you initialize the SDK, it begins downloading media content for the ads that will be displayed. Ads won’t be ready until this is complete.

It would also be useful if you could post device logs from your game, in case there are any errors happening.