Incredibly high crash rate when using CMP with Unity game

379 views
Skip to first unread message

AoC

unread,
Dec 16, 2023, 4:37:56 AM12/16/23
to Google Mobile Ads SDK Developers
Hello everyone,

I'm trying to integrate UMP before January 16th for compliance.

I did it with the Android version of one of my games, and the crash rate increased to 20%/30%, so I had to stop the rollout.

I'm using:
Unity 2022.3.14f1
Admob 8.6.0
Firebase 11.16.0

As mediation parterns, I'm using Unity and Facebook.

It looks like that the crash happens after a Rewarded Video is watched, and I suspect this reading the logs from crashlytics.
I have 2 types of crash logs from crashlytics:
Screenshot 2023-12-16 alle 10.28.53.png
Crashed: Thread: SIGTRAP  0x000027d200003d24
#00 pc 0xdcc38 libc.so (BuildId: 93a2374cdfb50508d0b4c009569a85c1)
#01 pc 0xaea448 libunity.so (DebugStringToFilePostprocessedStacktrace(DebugStringToFileData const&)) (BuildId: f95fe800e1cb63fb)
#02 pc 0x5550ac libunity.so (scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)) (BuildId: f95fe800e1cb63fb)
#03 pc 0x564294 libunity.so (ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)) (BuildId: f95fe800e1cb63fb)
#04 pc 0x111ead4 libunity.so (__unw_getcontext) (BuildId: f95fe800e1cb63fb)
#05 pc 0x56648c libunity.so (ScriptingInvocation::InvokeChecked(ScriptingExceptionPtr*)) (BuildId: f95fe800e1cb63fb)
#06 pc 0x10ce31c libunity.so (__unw_getcontext) (BuildId: f95fe800e1cb63fb)
#07 pc 0x5af5bc libunity.so (SerializableManagedRef::CallMethod(Object&, ScriptingMethodPtr)) (BuildId: f95fe800e1cb63fb)
#08 pc 0x60eb9c libunity.so (GetCoreScriptingClasses()) (BuildId: f95fe800e1cb63fb)
#09 pc 0x55e87c libunity.so (ScriptingGetComponentsOfTypeFromGameObject(ScriptingGetComponentsArgs const&, ScriptingExceptionPtr*)) (BuildId: f95fe800e1cb63fb)
#10 pc 0x3e4a1c libunity.so (std::__ndk1::__tree_iterator<DelayedCallManager::Callback, std::__ndk1::__tree_node<DelayedCallManager::Callback, void*>*, long> std::__ndk1::__tree<DelayedCallManager::Callback, std::__ndk1::less<DelayedCallManager::Callback>, memory_pool<DelayedCallManager::Callback>>::__emplace_multi<DelayedCallManager::Callback const&>(DelayedCallManager::Callback const&)) (BuildId: f95fe800e1cb63fb)
#11 pc 0x3e1b58 libunity.so (CallDelayed(CallObjectState (*)(Object*, void*), PPtr<Object>, float, void*, float, CallObjectState (*)(void*), DelayedCallManager::DelayedCallMode)) (BuildId: f95fe800e1cb63fb)
#12 pc 0x5735d8 libunity.so (MonoBehaviour::CallAwake()) (BuildId: f95fe800e1cb63fb)
#13 pc 0x5739e8 libunity.so (MonoBehaviour::AddToManager()) (BuildId: f95fe800e1cb63fb)
#14 pc 0x5b1008 libunity.so (AwakeFromLoadQueue::AwakeFromLoadAllQueues(AwakeFromLoadMode, bool)) (BuildId: f95fe800e1cb63fb)
#15 pc 0x5550ac libunity.so (scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)) (BuildId: f95fe800e1cb63fb)
#16 pc 0x564bf4 libunity.so (Scripting::ConnectScriptingWrapperToObject(ScriptingObjectPtr, Object*)) (BuildId: f95fe800e1cb63fb)
#17 pc 0x564294 libunity.so (ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)) (BuildId: f95fe800e1cb63fb)
#18 pc 0x111ead4 libunity.so (__unw_getcontext) (BuildId: f95fe800e1cb63fb)
#19 pc 0x3c95b0 libunity.so (GameObject::GetSupportedMessagesRecalculate()) (BuildId: f95fe800e1cb63fb)
#20 pc 0x3c8ddc libunity.so (GameObject::SetSupportedMessagesDirty()) (BuildId: f95fe800e1cb63fb)
#21 pc 0x573544 libunity.so (MonoBehaviour::AwakeFromLoad(AwakeFromLoadMode)) (BuildId: f95fe800e1cb63fb)
#22 pc 0x10c7ebc libunity.so (__unw_getcontext) (BuildId: f95fe800e1cb63fb)
#23 pc 0x4f0c70 libunity.so (UI::RectTransform::CalculateLocalPosition2() const) (BuildId: f95fe800e1cb63fb)
#24 pc 0x1118ffc libunity.so (__unw_getcontext) (BuildId: f95fe800e1cb63fb)
#25 pc 0x1118ffc libunity.so (__unw_getcontext) (BuildId: f95fe800e1cb63fb)
#26 pc 0x5706a8 libunity.so (ExecutionOrderManager::GetScriptExecutionOrder(int, Unity::Type const*) const) (BuildId: f95fe800e1cb63fb)
#27 pc 0x109c94c libunity.so (__unw_getcontext) (BuildId: f95fe800e1cb63fb)
#28 pc 0x5b104c libunity.so (AwakeFromLoadQueue::AwakeFromLoadAllQueues(AwakeFromLoadMode, bool)) (BuildId: f95fe800e1cb63fb)
#29 pc 0x5706a8 libunity.so (ExecutionOrderManager::GetScriptExecutionOrder(int, Unity::Type const*) const) (BuildId: f95fe800e1cb63fb)
#30 pc 0x109c94c libunity.so (__unw_getcontext) (BuildId: f95fe800e1cb63fb)
#31 pc 0x5b104c libunity.so (AwakeFromLoadQueue::AwakeFromLoadAllQueues(AwakeFromLoadMode, bool)) (BuildId: f95fe800e1cb63fb)
#32 pc 0x5c0a18 libunity.so (unsigned int std::__ndk1::__sort4<bool (*&)(AwakeFromLoadQueue::Item const&, AwakeFromLoadQueue::Item const&), AwakeFromLoadQueue::Item*>(AwakeFromLoadQueue::Item*, AwakeFromLoadQueue::Item*, AwakeFromLoadQueue::Item*, AwakeFromLoadQueue::Item*, bool (*&)(AwakeFromLoadQueue::Item const&, AwakeFromLoadQueue::Item const&))) (BuildId: f95fe800e1cb63fb)
#33 pc 0x5b1108 libunity.so (AwakeFromLoadQueue::InvokeAwakeFromLoad(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode)) (BuildId: f95fe800e1cb63fb)
#34 pc 0x10ce31c libunity.so (__unw_getcontext) (BuildId: f95fe800e1cb63fb)
#35 pc 0x5b0fe4 libunity.so (AwakeFromLoadQueue::AwakeFromLoadAllQueues(AwakeFromLoadMode, bool)) (BuildId: f95fe800e1cb63fb)
#36 pc 0x5b1008 libunity.so (AwakeFromLoadQueue::AwakeFromLoadAllQueues(AwakeFromLoadMode, bool)) (BuildId: f95fe800e1cb63fb)
#37 pc 0x3c92f0 libunity.so (GameObject::ActivateAwakeRecursively(DeactivateOperation)) (BuildId: f95fe800e1cb63fb)


And the other one is this:

Crashed: Thread: SIGTRAP  0x000027d200003817
#00 pc 0xdcc38 libc.so (BuildId: 93a2374cdfb50508d0b4c009569a85c1)
#01 pc 0xaea448 libunity.so (DebugStringToFilePostprocessedStacktrace(DebugStringToFileData const&)) (BuildId: f95fe800e1cb63fb)
#02 pc 0x11d6578 libil2cpp.so (il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) [Runtime.cpp:592]) (BuildId: 68d6dea610d27a09)
#03 pc 0x11d6578 libil2cpp.so (il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) [Runtime.cpp:592]) (BuildId: 68d6dea610d27a09)
#04 pc 0x11960c0 libil2cpp.so (il2cpp::icalls::mscorlib::System::Reflection::RuntimeMethodInfo::InternalInvoke(Il2CppReflectionMethod*, Il2CppObject*, Il2CppArray*, Il2CppException**) [RuntimeMethodInfo.cpp:186]) (BuildId: 68d6dea610d27a09)


This is my implementation of the Rewarded Video:

public void WatchVideo(Action<bool> onVideoRewarded, string source)
{
if (rewardedAd != null && rewardedAd.CanShowAd())
{
MobileAdsEventExecutor.ExecuteInUpdate(() =>
{
Crashlytics.Log("WatchVideo");
this.rewardedAd.Show((result) =>
{
onVideoRewarded.Invoke(true);
});
});
}
}


public void RequestVideo()
{

Crashlytics.Log("RequestVideo");

if (rewardedAd != null)
{
rewardedAd.Destroy();
rewardedAd = null;
}

lastRewardeVideoAdUnit = rewardedAdUnitIds[rewardedAdUnitIndex];
AdRequest adRequest = GetAdRequest();
RewardedAd.Load(lastRewardeVideoAdUnit, adRequest,
(RewardedAd ad, LoadAdError error) =>
{
// if error is not null, the load request failed.
if (error != null || ad == null)
{
Debug.LogError("Rewarded ad failed to load an ad " +
"with error : " + error);
rewardedAdUnitIndex = (rewardedAdUnitIndex + 1) % rewardedAdUnitIds.Length;
StartCoroutine(LoadWithDelay(RequestVideo));
Crashlytics.Log("Video Failed");
return;
}

Debug.Log("Rewarded ad loaded with response : "
+ ad.GetResponseInfo());

rewardedAdUnitIndex = 0;
rewardedAd = ad;
rewardedAd.OnAdFullScreenContentClosed += HandleRewardedAdClosed;
rewardedAd.OnAdFullScreenContentFailed += HandleRewardedAdFailedToLoad;
Crashlytics.Log("Video Loaded");
});
}

public void HandleRewardedAdFailedToLoad(AdError error)
{
MobileAdsEventExecutor.ExecuteInUpdate(() =>
{
rewardedAdUnitIndex = (rewardedAdUnitIndex + 1) % rewardedAdUnitIds.Length;
StartCoroutine(LoadWithDelay(RequestVideo));
});
}

public void HandleRewardedAdClosed()
{
MobileAdsEventExecutor.ExecuteInUpdate(() =>
{
StartCoroutine(LoadWithDelay(RequestVideo));
Crashlytics.Log("RewardedClosed");

});
}

IEnumerator LoadWithDelay(Action load)
{
if (!UmpManager.Instance.HasMinimumConsent())
{
UmpManager.Instance.OnConsentChanged += Load;
yield break;
}

yield return waitForSeconds;

MobileAdsEventExecutor.ExecuteInUpdate(() =>
{
load();
});
}

Can anyone help me?

Mobile Ads SDK Forum Advisor

unread,
Dec 18, 2023, 12:32:35 AM12/18/23
to aceofclu...@gmail.com, google-adm...@googlegroups.com

Hi, 

Thank you for contacting the Mobile Ads SDK Support team.

By reviewing your concern, I understand that you are facing issues with Rewarded ads. Kindly share the below information to investigate further. 

  • Mobile Ads SDK Version
  • App ID and Ad Unit ID
  • Sample project which replicates the issue.
  • Steps to replicate the issue

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002r2ByJQAU&entry.80707362=00215640

2. Fill out all fields, and attach your file(s).

3. Please reply back to this thread when you have uploaded your file(s). Please do not share this link.


 
This message is in relation to case "ref:!00D1U01174p.!5004Q02r2ByJ:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Reply all
Reply to author
Forward
0 new messages