Crash on Android dismissing rewarded video Monetization 3.0 plugin

It seems there an error when releasing the ad or ad view or something like that.

I’ve tried in Mono and Il2CPP same result.

Works on iOS.
Worked on Android with services ads plugin but not monetization 3.0

Hello @Antony-Blackett . Can you provide the repro steps?

I logged a bug with an attached project

Case 1095893

Hi, the log looked like it was the ad crashing only on Android, but on further investigation it’s actually something in the callback on ad close. I’m looking into it further, i’m unsure why it only happens on android and with the latest monetization plugin.

I’ll keep you posted. I also updated the bug case with this info.

Cheers.

Update:

It’s strange. If I move the stuff in the callback to happen in update the frame later, no crash, everything is fine. But I can’t figure out why the crash happens.

I’m seeing similar behaviour with Unity Ads supplied via AdMob mediation. When you dismiss a Unity Ad my application crashes but only on Android. Planning on doing more investigation this evening.

Same problem here … Systematic crash when closing an ad on android (rewarded or interstitial) … I am investigating in my side …

I’m having the same issue on my game, some phones crashes after watching an AD (interstitial). Do you confirm that Waiting the next frame corrects the issue ? Could be a simple workaround to make but I have no way to test it (can’t reproduce the crash on my phones) …

@Antony-Blackett , @Nowlz , @thibouf , @pikatch

Thanks for the reports. The SDK team is investigating this issue.

Here’s what I’m seeing in the editor.log

0x00000001417BB06B (Unity) StackWalker::GetCurrentCallstack
0x00000001417BCD4F (Unity) StackWalker::ShowCallstack
0x0000000141796B60 (Unity) GetStacktrace
0x0000000140D4D25B (Unity) DebugStringToFile
0x0000000140D4DA3C (Unity) DebugStringToFile
0x0000000140E95113 (Unity) GeneralConnection::Connection::SendMessageA
0x0000000140E96239 (Unity) GeneralConnection::SendMessageA
0x000000014102F46E (Unity) ProfilerConnection::SetConnectedProfiler
0x0000000140E971BC (Unity) GeneralConnection::smile:isconnect
0x0000000140E9975C (Unity) GeneralConnection::Poll
0x0000000140E9BB1E (Unity) EditorConnection::PollWithCustomMessage
0x0000000141740482 (Unity) Application::TickTimer
0x000000014180C9CC (Unity) CrashCallback
0x000000014180E554 (Unity) WinMain
0x0000000141AF369C (Unity) strnlen
0x00007FF9EF533034 (KERNEL32) BaseThreadInitThunk
0x00007FF9F1721461 (ntdll) RtlUserThreadStart

Hello @Antony-Blackett ,

Our initial investigation has found that it appears the callbacks aren’t invoked on Unity’s main thread on Android, but is doing so on iOS. It will be inconvenient, but for now you’ll have to do the Unity GameObject manipulation on the next frame for Android.

This will be fixed in our next patch release, and we will also be adding this as a test case for future releases. Thanks for reporting this!

I also want to add that the startCallback is invoked on the UI thread, and calling it on the Main Thread can’t be done because Unity is paused during Ad playback.

RR

2 Likes

Ah ok,

Good to know that my workaround fix is indeed the correct fix for the moment. Thanks for the quick response.

Cheers,
Antony.

1 Like

Any hint as to when the next patch may be released?

hi, the problem in unit 2018.3.0f2 is the same. on Android it causes crashes at the beginning of the level that runs the script. If I do a build without ads, everything works. Reading around hypothesize that the problem occurs when the function returns NULL:

private IEnumerator ShowAdWhenReady()
{
while (!Monetization.IsReady(placementId))
{

yield return new WaitForSeconds(0.25f);

}

ShowAdPlacementContent ad = null;

ad = Monetization.GetPlacementContent(placementId) as ShowAdPlacementContent;

if (ad != null){
ad.Show();

}

}
any idea to bypass this problem?

Ty!!

2 Likes

@Simone82

Can you open a support ticket and provide a device log from when the crash is happening:
unityads-support@unity3d.com

Guys, please patch this issue.
Seems like nothing has changed since October.

@RossRothenstineU3D
Any updates on this issue? When can we expect fix?

same error here please fix en release 2018 f2

Hey man, How did you do it?
As in how did you move the stuff in the callback to happen in update the frame later? I have spent an entire day trying to figure it out. Nothing came of it.

I am beginner to intermediate in scripting so those instructions you wrote goes over my head.
Could you kindly tell me how I can solve this issue?