ANRs Caused by UMP 2.1.0 Callbacks

669 views
Skip to first unread message

Usama Nawaz

unread,
Nov 12, 2023, 1:33:18 AM11/12/23
to Google Mobile Ads SDK Developers
I have a game published which has user around 300-400 on average for the last 30 minutes almost everytime on firebase. I am getting an error on and off on some of the devices which states as follows: 

com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native method)
com.unity3d.player.ReflectionHelper.a (unavailable)
com.unity3d.player.ReflectionHelper$1.invoke (unavailable:31)
java.lang.reflect.Proxy.invoke (Proxy.java:1006)
com.google.android.ump.ConsentInformation$OnConsentInfoUpdateSuccessListener.onConsentInfoUpdateSuccess (com.google.android.ump:user-messaging-platform@@2.1.0)
com.google.android.gms.internal.consent_sdk.zzt.run (unavailable:2)
android.os.Handler.handleCallback (Handler.java:942)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loopOnce (Looper.java:226)
android.os.Looper.loop (Looper.java:313)
android.app.ActivityThread.main (ActivityThread.java:8762)
java.lang.reflect.Method.invoke (Native method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:604)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)

Please note that I have already implemented UMP with all of my games and none of them is having this kind issue. I am using unity 2021.3.2 and GMA SDK 8.5.3 with UMP 2.1.0. Attached are the screenshots.


UMP error 01.PNGUMP error 02.PNGUMP error 03.PNGUMP error 04.PNGUMP error 7Days.PNG

Usama Nawaz

unread,
Nov 13, 2023, 8:45:36 AM11/13/23
to Google Mobile Ads SDK Developers
I have added this in Proguard-user.txt also. But still alot of ANRs

-keep class com.google.unity.** {
   *;
}
-keep public class com.google.android.gms.ads.**{
   public *;
}
-keep public class com.google.ads.**{
   public *;
}
-keep public class com.google.android.ump.**{
   public *;
}
-keepattributes Annotation
-dontobfuscate

Mobile Ads SDK Forum Advisor

unread,
Nov 13, 2023, 11:06:27 PM11/13/23
to usaman...@gmail.com, google-adm...@googlegroups.com

Hi Usama,

Thank you for contacting the Mobile Ads SDK support team.

Upon reviewing your concern, I understand that you are facing an ANRs issue with UMP 2.1.0 Callbacks.

Can you confirm that the ANRs caused by the UMP 2.1.0 issue are reproducible by using our Google Samples? Also, Optimize initialization and ad loading to improve the overall responsiveness of ads and help prevent "Application Not Responding" (ANR) errors on your app.

Kindly share the below information privately for further investigation:

  • app ID
  • ad unit ID
  • The full stack trace
  • Steps to reproduce
  • Sample app reproducing the issue

 You can provide the following details via reply privately to the author option or directly provide it to the link below.

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=5004Q00002qBs8tQAC&entry.80707362=00210245

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

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

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

Thanks,
 
Google Logo Mobile Ads SDK Team


Alex

unread,
Jan 15, 2024, 10:21:48 PMJan 15
to Google Mobile Ads SDK Developers
Hello,
I have the same error.
Can't reproduce it locally but based on the stack trace the problem lies here: "OnConsentInfoUpdateSuccessListener".
This part of code goes after consent was updated.
Most of the time happens on HUAWEI and HONOR devices.

вторник, 14 ноября 2023 г. в 06:06:27 UTC+2, Mobile Ads SDK Forum Advisor:

Mobile Ads SDK Forum Advisor

unread,
Jan 16, 2024, 2:22:39 AMJan 16
to mrsh...@gmail.com, google-adm...@googlegroups.com

Hi Alex,

Thank you for contacting the Mobile Ads SDK Support team.

By reviewing your concern, I understand that you are facing ANRs Caused by UMP 2.1.0 Callbacks

I will check with our team regarding your query and one of my team members will reach out to you once we have an update on this. Meanwhile, your patience is highly appreciated.  

Mobile Ads SDK Forum Advisor

unread,
Jan 16, 2024, 2:02:33 PMJan 16
to mrsh...@gmail.com, google-adm...@googlegroups.com

Hi Alex,

My name is Nick and I am looking into these UMP crashes.

Can you give me some details on your current environment? Specifically I am looking for plugin version and how you are loading dependencies. We recently had to change our dependency loading process for Unity 2021 and I am wondering which solution you landed on. Are you using EDM4U to resolve dependencies or gradle?

Looking forward to your answer,

Nick



ref:!00D1U01174p.!5004Q02qBs8t:ref

Alex

unread,
Jan 16, 2024, 6:54:35 PMJan 16
to Google Mobile Ads SDK Developers
In "Assets/Plugins/Android/baseProjectTemplate.gradle" classpath 'com.android.tools.build:gradle:4.2.1'.

вторник, 16 января 2024 г. в 21:02:33 UTC+2, Mobile Ads SDK Forum Advisor:

Alex

unread,
Jan 16, 2024, 6:54:38 PMJan 16
to Google Mobile Ads SDK Developers
Hi Nick,

I am using 
Unity 2021.3.34,
Google Mobile Ads Unity Plugin v8.6.0,
Gradle version 6.7.1,
for resolve dependencies EDM4U.

Regards,
Alex.
вторник, 16 января 2024 г. в 21:02:33 UTC+2, Mobile Ads SDK Forum Advisor:

Mobile Ads SDK Forum Advisor

unread,
Jan 16, 2024, 7:29:42 PMJan 16
to mrsh...@gmail.com, google-adm...@googlegroups.com
Hi Alex,

I was able to replicate and confirmed the error. I have an engineer looking into the issue. We will update you once we have next steps.

Thanks,

Alex

unread,
Feb 5, 2024, 2:29:25 PMFeb 5
to Google Mobile Ads SDK Developers
Do you have any update?
The issue still persists.

среда, 17 января 2024 г. в 02:29:42 UTC+2, Mobile Ads SDK Forum Advisor:

Mobile Ads SDK Forum Advisor

unread,
Feb 6, 2024, 7:06:14 PMFeb 6
to mrsh...@gmail.com, google-adm...@googlegroups.com
Hello Alex,

I have reached out to the engineering team and they are still investigating the issue. I will let you know once there is an update.

Thanks!


Regards,
Joshua

ref:!00D1U01174p.!5004Q02qBs8t:ref

Alex

unread,
Feb 23, 2024, 6:39:54 AMFeb 23
to Google Mobile Ads SDK Developers
Hello Joshua,

I still have this issues.
Do you have any ETA on the fix for this issue?
The issue started to appear last year, your company asked us to provide their new consent and it gives the error. What should we do?

Regards,
Alex.

среда, 7 февраля 2024 г. в 02:06:14 UTC+2, Mobile Ads SDK Forum Advisor:

Alex

unread,
Feb 28, 2024, 12:20:24 PMFeb 28
to Google Mobile Ads SDK Developers
Stacktrace from Google Play:
"main" tid=1 Native
  #00  pc 0x00000000000bbb68  /apex/com.android.runtime/lib64/bionic/libc.so (nanosleep+8)
  #01  pc 0x00000000010f1a3c  /data/app/com.xxx.xxx-zUHfvSFEBeKMDiMjGQgUxg==/lib/arm64/libil2cpp.so (GC_err_printf) (BuildId: e2a31ecda41572f6f75cba99c7eff298f7839f7f)
  #02  pc 0x00000000001d407c  [anon:dalvik-/data/app/com.xxx.xxx-zUHfvSFEBeKMDiMjGQgUxg==/oat/arm64/base.art]
  at com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native method)
  at com.unity3d.player.ReflectionHelper.-$$Nest$smnativeProxyInvoke (unavailable)
  at com.unity3d.player.ReflectionHelper$a.invoke (unavailable)
  at java.lang.reflect.Proxy.invoke (Proxy.java:1006)
  at com.google.android.ump.ConsentInformation$OnConsentInfoUpdateSuccessListener.onConsentInfoUpdateSuccess (com.google.android.ump:user-messaging-platform@@2.1.0)
  at com.google.android.gms.internal.consent_sdk.zzt.run (com.google.android.ump:user-messaging-platform@@2.1.0)
  at android.os.Handler.handleCallback (Handler.java:900)
  at android.os.Handler.dispatchMessage (Handler.java:103)
  at android.os.Looper.loop (Looper.java:219)
  at android.app.ActivityThread.main (ActivityThread.java:8668)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:513)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1109)"

And file with full stacktrace attached.

пятница, 23 февраля 2024 г. в 13:39:54 UTC+2, Alex:
stacktrace (1).log
Message has been deleted

Alex

unread,
Apr 1, 2024, 2:03:55 PMApr 1
to Google Mobile Ads SDK Developers
Still happens on user-messaging-platform 2.2.0 updated in Google Mobile Ads Unity Plugin v9.0.0.


""main" tid=1 Native
  #00  pc 0x00000000000bbb68  /apex/com.android.runtime/lib64/bionic/libc.so (nanosleep+8)
  #01  pc 0x00000000010e4b3c  /data/app/com.xxx.xxx-tTqgxws_FqBazDWR-lcR3Q==/lib/arm64/libil2cpp.so (GC_err_printf+1808) (BuildId: 9c3231a4adf6deefd6005a416dbd3ab45b162fd7)
  #02  pc 0x00000000001b5374  [anon:dalvik-/data/app/com.xxx.xxx-tTqgxws_FqBazDWR-lcR3Q==/oat/arm64/base.art]

  at com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native method)
  at com.unity3d.player.ReflectionHelper.-$$Nest$smnativeProxyInvoke (unavailable)
  at com.unity3d.player.ReflectionHelper$a.invoke (unavailable)
  at java.lang.reflect.Proxy.invoke (Proxy.java:1006)
  at com.google.android.ump.ConsentInformation$OnConsentInfoUpdateSuccessListener.onConsentInfoUpdateSuccess (com.google.android.ump:user-messaging-platform@@2.2.0)
  at com.google.android.gms.internal.consent_sdk.zzt.run (com.google.android.ump:user-messaging-platform@@2.2.0)

  at android.os.Handler.handleCallback (Handler.java:900)
  at android.os.Handler.dispatchMessage (Handler.java:103)
  at android.os.Looper.loop (Looper.java:219)
  at android.app.ActivityThread.main (ActivityThread.java:8668)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:513)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1109)"

среда, 28 февраля 2024 г. в 19:20:24 UTC+2, Alex:

Mobile Ads SDK Forum Advisor

unread,
Apr 3, 2024, 12:14:32 PMApr 3
to mrsh...@gmail.com, google-adm...@googlegroups.com
Hello Alex,

Thanks for bumping the thread.

The team is actively investigating the issue and we will get back to you as soon as there is an update.

Mobile Ads SDK Forum Advisor

unread,
Apr 3, 2024, 1:06:18 PMApr 3
to mrsh...@gmail.com, google-adm...@googlegroups.com
Hi Alex,

Looking at the stack trace it looks like this crash happens after UMP sends the call back to the Unity3d layer. Can you share the code you have for handling the UMP callback?

 
""main" tid=1 Native
  #00  pc 0x00000000000bbb68  /apex/com.android.runtime/lib64/bionic/libc.so (nanosleep+8)
  #01  pc 0x00000000010e4b3c  /data/app/com.xxx.xxx-tTqgxws_FqBazDWR-lcR3Q==/lib/arm64/libil2cpp.so (GC_err_printf+1808) (BuildId: 9c3231a4adf6deefd6005a416dbd3ab45b162fd7)
  #02  pc 0x00000000001b5374  [anon:dalvik-/data/app/com.xxx.xxx-tTqgxws_FqBazDWR-lcR3Q==/oat/arm64/base.art]
  at com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native method)
  at com.unity3d.player.ReflectionHelper.-$$Nest$smnativeProxyInvoke (unavailable)
  at com.unity3d.player.ReflectionHelper$a.invoke (unavailable)
  at java.lang.reflect.Proxy.invoke (Proxy.java:1006)
  at com.google.android.ump.ConsentInformation$OnConsentInfoUpdateSuccessListener.onConsentInfoUpdateSuccess (com.google.android.ump:user-messaging-platform@@2.2.0)

Alex

unread,
Apr 3, 2024, 1:20:37 PMApr 3
to Google Mobile Ads SDK Developers
Hi Nick,
Here's my class for consent form.
The code taken from th Google's FAQ for implementing consent.
Please, tell me if there is an issue.


среда, 3 апреля 2024 г. в 20:06:18 UTC+3, Mobile Ads SDK Forum Advisor:
AdmobConsent.cs

Mobile Ads SDK Forum Advisor

unread,
Apr 4, 2024, 4:24:03 PMApr 4
to mrsh...@gmail.com, google-adm...@googlegroups.com
Alex,

Thanks for the update. We will take another look at this issue. If you have any further updates, please do not hesitate to reach out again.

qbi...@gmail.com

unread,
Apr 9, 2024, 9:08:54 AMApr 9
to Google Mobile Ads SDK Developers
We have the same ANR:
com.google.android.ump:user-messaging-platform@@2.1.0 - com.google.android.ump.ConsentInformation$OnConsentInfoUpdateSuccessListener.onConsentInfoUpdateSuccess

Could you please share Java code of the relevant listener?

बलराम महतो

unread,
Apr 10, 2024, 6:27:33 PMApr 10
to Google Mobile Ads SDK Developers
शुक्रवार, 5 अप्रैल 2024 को 1:54:03 am UTC+5:30 बजे Mobile Ads SDK Forum Advisor ने लिखा:
Screenshot_20240326_035641.jpg

Mobile Ads SDK Forum Advisor

unread,
Apr 11, 2024, 1:37:42 PMApr 11
to b899...@gmail.com, google-adm...@googlegroups.com
Hi,

Can you please try uninstalling and reinstalling the Google Mobile Ads plugin. I was able to fix a broken project with this step.

Alex

unread,
Apr 18, 2024, 11:59:08 AM (14 days ago) Apr 18
to Google Mobile Ads SDK Developers
Hi,

I tried to delete everything connected to the Google Mobile Ads SDK from project, close project, open it, reinstall Google Mobile Ads SDK once again.
Nothing changed. The issue still exist.

Need help as I have this issue too much time!

четверг, 11 апреля 2024 г. в 20:37:42 UTC+3, Mobile Ads SDK Forum Advisor:

Pavel “MalyaWka” Pustovalov

unread,
Apr 22, 2024, 5:22:58 AM (10 days ago) Apr 22
to Google Mobile Ads SDK Developers
Hey there!
 
Perhaps this will shed some light on the issue?! The log clearly indicates that it's causing the main thread to block. 
If it's a lengthy operation, maybe it shouldn't be done on the main thread?

______________________________________________________________________________________________
main (waiting):tid=1 systid=17830
       at java.lang.Object.wait(Native method)
       at java.lang.Object.wait(Object.java:442)
       at java.lang.Object.wait(Object.java:568)
       at android.app.SharedPreferencesImpl.awaitLoadedLocked(SharedPreferencesImpl.java:279)
       at android.app.SharedPreferencesImpl.getString(SharedPreferencesImpl.java:301)
       at com.google.android.gms.internal.ads.zzbcx.zza(com.google.android.gms:play-services-ads-lite@@22.6.0:1)
       at com.google.android.gms.internal.ads.zzbdh.zza(com.google.android.gms:play-services-ads-lite@@22.6.0:7)
       at com.google.android.gms.internal.ads.zzbda.zzd(com.google.android.gms:play-services-ads-lite@@22.6.0:1)
       at com.google.android.gms.internal.ads.zzbda.zzc(com.google.android.gms:play-services-ads-lite@@22.6.0:11)
       at com.google.android.gms.internal.ads.zzbdb.zza(com.google.android.gms:play-services-ads-lite@@22.6.0:1)
       at com.google.android.gms.internal.ads.zzbdh.zza(com.google.android.gms:play-services-ads-lite@@22.6.0:7)
       at com.google.android.gms.internal.ads.zzbdc.zza(com.google.android.gms:play-services-ads-lite@@22.6.0:1)
       at com.google.android.gms.ads.internal.client.zzax.zzd(com.google.android.gms:play-services-ads-lite@@22.6.0:6)
       at com.google.android.gms.ads.internal.client.zzej.zzA(com.google.android.gms:play-services-ads-lite@@22.6.0:3)
       at com.google.android.gms.ads.internal.client.zzej.zzm(com.google.android.gms:play-services-ads-lite@@22.6.0:8)
       at com.google.android.gms.ads.MobileAds.initialize(com.google.android.gms:play-services-ads-lite@@22.6.0:3)
       at com.unity3d.player.ReflectionHelper.nativeProxyInvoke(Native method)
       at com.unity3d.player.ReflectionHelper.a(unavailable)
       at com.unity3d.player.ReflectionHelper$1.invoke(unavailable)
       at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
       at com.google.android.ump.ConsentInformation$OnConsentInfoUpdateSuccessListener.onConsentInfoUpdateSuccess(com.google.android.ump:user-messaging-platform@@2.1.0)
       at com.google.android.gms.internal.consent_sdk.zzt.run(com.google.android.ump:user-messaging-platform@@2.1.0)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7948)
       at java.lang.reflect.Method.invoke(Native method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:603)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
______________________________________________________________________________________________

четверг, 11 апреля 2024 г. в 20:37:42 UTC+3, Mobile Ads SDK Forum Advisor:

qbi...@gmail.com

unread,
Apr 25, 2024, 3:08:39 AM (7 days ago) Apr 25
to Google Mobile Ads SDK Developers
Hi Pavel,


>  If it's a lengthy operation, maybe it shouldn't be done on the main thread?

Maybe, but we cannot be sure until we see the sources of your Java library and Unity plugin.
On the caller side in C#, I do nothing more than capturing the returned result:

private void UpdateConsentInformation(TaskCompletionSource<UpdatedConsentInformation> promise)
{

    ConsentInformation.Update(_request, OnConsentInformationUpdated);
    return;

    void OnConsentInformationUpdated(FormError? formError)
    {
        if (formError is not null)
            promise.TrySetException(new FormException(formError));
        else
            promise.TrySetResult(new UpdatedConsentInformation(_request));
    }
}

Mobile Ads SDK Forum Advisor

unread,
Apr 25, 2024, 1:40:33 PM (7 days ago) Apr 25
to qbi...@gmail.com, google-adm...@googlegroups.com
Hi,

I was able to replicate the issue in the latest version. I have escalated the issue and will let you know when we have a work around.

Thank you for your patience on this issue,

Mobile Ads SDK Forum Advisor

unread,
Apr 25, 2024, 7:23:36 PM (7 days ago) Apr 25
to qbi...@gmail.com, google-adm...@googlegroups.com
Hi,

I was able to get to the cause of the issue. The issue is we are missing the Unity Android JNI dependency in the project. The solution is to add the Android JNI dependency using package manager.

Open the Unity Editor menu  `Window -> Package Manager` select `Build In` packages and install `Android JNI`. 

Hope this helps,

Alex

unread,
Apr 25, 2024, 7:34:01 PM (7 days ago) Apr 25
to Google Mobile Ads SDK Developers
Hi,

All my projects have this dependency. So it's not the cause of the issue.
Also the issue still exist for Google Mobile Ads Unity Plugin v9.1.0.
The issue takes significant part of all crashes so it causes bad arrangement in Google Play.

пятница, 26 апреля 2024 г. в 02:23:36 UTC+3, Mobile Ads SDK Forum Advisor:

qbi...@gmail.com

unread,
Apr 25, 2024, 7:47:24 PM (7 days ago) Apr 25
to Google Mobile Ads SDK Developers
Hi Mobile Ads SDK Forum Advisor,

>  Hope this helps

Unfortunately, the built-in Android JNI package is already enabled, so it is not the cause of the problem.

Mobile Ads SDK Forum Advisor

unread,
Apr 26, 2024, 2:12:26 PM (6 days ago) Apr 26
to qbi...@gmail.com, google-adm...@googlegroups.com
I will need a sample application I can run locally to progress further then. 

Looking forward to this,
Reply all
Reply to author
Forward
0 new messages