googleads / googleads-mobile-unity

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

Crash UnityNativeTemplateAd$10.run #3670

Open mmsbba4 opened 2 days ago

mmsbba4 commented 2 days ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

My game uses native overlay ads. This error shows up in firebase Crashlytics at a very high rate. did i make a mistake somewhere? Below is the error code :

Fatal Exception: java.lang.Error FATAL EXCEPTION [main] Unity version : 2022.3.32f1 Device model : OPPO CPH2495 Device fingerprint: OPPO/CPH2495/OP52F3L1:14/UP1A.230620.001/T.R4T2.18c46bd-594b:user/release-keys CPU supported ABI : [arm64-v8a, armeabi-v7a, armeabi] Build Type : Release Scripting Backend : IL2CPP Libs loaded from : lib/arm64 Strip Engine Code : true

Caused by java.lang.NullPointerException Attempt to invoke virtual method 'void com.google.android.ads.nativetemplates.TemplateView.setVisibility(int)' on a null object reference

com.google.unity.ads.nativead.UnityNativeTemplateAd$10.run (UnityNativeTemplateAd.java:403) android.os.Handler.handleCallback (Handler.java:958) android.os.Handler.dispatchMessage (Handler.java:99) android.os.Looper.loopOnce (Looper.java:257) android.os.Looper.loop (Looper.java:368) android.app.ActivityThread.main (ActivityThread.java:8826) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:572) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1049)

NVentimiglia commented 19 hours ago

Hi,

Can you include some sample code / replication steps on how you found this error ? In what order did you call the APIs?