googleads / googleads-mobile-unity

Official Unity Plugin for the Google Mobile Ads SDK
https://developers.google.com/admob/unity
Apache License 2.0
1.32k stars 1.09k forks source link

[Google Mobile Ads Android SDK 23.0.0 Causing ANRs][Android] #3324

Closed MuhammadWaqasOfficial closed 1 week ago

MuhammadWaqasOfficial commented 1 week ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

All GMA Unity Packages supporting GMA 23.0.0 causing huge ANRs spike. All anrs refereeing to com.google.android.gms:play-services-ads:23.0.0 at com.google.android.gms.ads.initialization.OnInitializationCompleteListener.onInitializationComplete().

I know its not under GMA unity, but you can refer them. because they are not giving any solution at any forum for GMA developers groups.

anr

for more detail please check 1- https://github.com/googleads/googleads-mobile-unity/issues/3227 2- https://groups.google.com/g/google-admob-ads-sdk/c/TjU2YunGW-g

MuhammadWaqasOfficial commented 1 week ago

Google Mobile Ads Android SDK 22.5.0 & 22.6.0 supporting GMA unity (8.6.0 & 8.7.0) have same ANRs Spike as well.

MuhammadWaqasOfficial commented 1 week ago

No ANR in GMA Unity 8.2.0 (GMA 22.0.0)

NVentimiglia commented 1 week ago

Thank you. I have confirmed the issue and we are looking into this.

NVentimiglia commented 1 week ago

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, Nick

MuhammadWaqasOfficial commented 1 week ago

I checked, Android JNI is already installed and enabled.

Android JNI