Rewarded Videos not loading on Android

Hi!

My rewarded videos are working just fine inside the editor. However, after building for Android, only my interstials still show up. My rewarded video never Invokes OnUnityAdsReady. Instead, this error shows up in Logcat. Hopefully someone here can help me out!

2021.05.31 23:50:49.604 7718 7718 Error UnityAds com.unity3d.services.store.StoreBilling.asInterface() (line:28) :: Billing service stub not found: com.android.vending.billing.IInAppBillingService$Stub: Didn't find class "com.android.vending.billing.IInAppBillingService$Stub" on path: DexPathList[[zip file "/data/app/~~qPUdV353UcD-LvyOukzwPw==/com.BrunchtimeStudio.BitClicker-5Jdy86LYME5PrMLKNelMpg==/base.apk", zip file "/data/app/~~qPUdV353UcD-LvyOukzwPw==/com.BrunchtimeStudio.BitClicker-5Jdy86LYME5PrMLKNelMpg==/split_config.arm64_v8a.apk"],nativeLibraryDirectories=[/data/app/~~qPUdV353UcD-LvyOukzwPw==/com.BrunchtimeStudio.BitClicker-5Jdy86LYME5PrMLKNelMpg==/lib/arm64, /data/app/~~qPUdV353UcD-LvyOukzwPw==/com.BrunchtimeStudio.BitClicker-5Jdy86LYME5PrMLKNelMpg==/base.apk!/lib/arm64-v8a, /data/app/~~qPUdV353UcD-LvyOukzwPw==/com.BrunchtimeStudio.BitClicker-5Jdy86LYME5PrMLKNelMpg==/split_config.arm64_v8a.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64]]

I’m testing on Android 10/11, Unity 2020.3.10f, use Unity Advertisements 3.7.1 and Play Games Services v10.12.

1 Like

@Sidox

That error message is likely unrelated.

There is a known issue with SDK 3.7.1 and the OnUnityAdsReady listener. We hope to have the issue fixed in a future version. Right now there are two workarounds available:

  1. You can replace OnUnityAdsReady and IUnityAdsListener with a new set of listeners:
    IUnityAdsInitializationListener
    IUnityAdsLoadListener
    IUnityAdsShowListener

  2. You can initialize with the enablePerPlacementLoad flag and then call Advertisement.Load. This will allow the OnUnityAdsReady to function again.

1 Like

is this still valid in 3.7.3 ?
i have the same error.
in workaround 1 : do you need all three :confused: ? listeners ?

in workaround 2 : i assume enablePerPlacementLoad should be true ?
Then i wait for OnUnityAdsReady in general, or for every time the user chooses to watch a video ? and call something else beforehand ?
The api is a wee bit scarce on the subject, or maybe i’m already overworked :slight_smile:

Apart from that : with Workaround 2 comes another problem :
… unity docs : " … If you initialized the SDK with enablePerPlacementLoad enabled, you must call Load before calling Show. Note that the Load API is in beta and available upon invite only. If you would like to be considered for the beta, please contact us at unityads-support@unity3d.com."

And then : If i initialize with
Advertisement.Initialize (mygameId, testMode , true);
then will this call the
IUnityAdsInitializationListener callbacks ??

It doesn’t seem so.

How can i initialize and get the right callbacks called back ?

i have the same error.
on ios

In short : The question is.
How does one initialize the Ads with
Advertisement.Initialize (gameId, testMode , enablePerPlacementLoad);
and get it to use the callbacks for the three above mentioned interfaces. ??

in the Docs it uses :
Advertisement.AddListener (this);
to add the IUnityAdsListener interface.
Advertisement.AddListener does not accept any other than an IUnityAdsListener though.

Assumably the callbacks will never be called, because no Listeners have been given to the Advertisment Class to call.

A far as I see, these are split up
You use first of all
Advertisement.Initialize(gameId, testMode, true, this), here this is the IUnityAdsInitializationManager
Then
Advertisement.Load(placementId, this) for your LoadListener
and finally
Advertisement.Show(placementid, this) for your show listener

Also as a sidenote, I just got this working, first you Initialize in Start, then in OnInitializationComplete you call the Loads for your placements, then you can play the ads just fine and your OnUnityAdsAdLoaded will get called

1 Like

Thanks gorbit99
So the loadlistener gets the call only after specifically using the load method, not simply with the initialization. Got it.
Makes sense

Another workaround is to check “Advertisement.IsReady(adId)” in a coroutine. That was my quick workaround when noticing OnUnityAdsReady is not reliable.