I am using Admob sdk 18.1.1
and getting error Uncaught exception thrown by finalizer
java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'FinalizerDaemon'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 2) {f4f671a} called on null, FYI main Looper is Looper (main, tid 2) {f4f671a})
Is this issue occurred inside the admob sdk ?
Stack trace:
at android.webkit.WebView.checkThread(WebView.java:2732)
at android.webkit.WebView.evaluateJavascript(WebView.java:1128)
at com.google.android.gms.internal.ads.zzbbq.evaluateJavascript(com.google.android.gms:play-services-ads@@18.1.1:108)
at com.google.android.gms.internal.ads.zzbbq.zza(com.google.android.gms:play-services-ads@@18.1.1:144)
at com.google.android.gms.internal.ads.zzbbq.zzfk(com.google.android.gms:play-services-ads@@18.1.1:151)
at com.google.android.gms.internal.ads.zzbbq.zza(com.google.android.gms:play-services-ads@@18.1.1:190)
at com.google.android.gms.internal.ads.zzbbq.zza(com.google.android.gms:play-services-ads@@18.1.1:101)
at com.google.android.gms.internal.ads.zzbbq.zzav(com.google.android.gms:play-services-ads@@18.1.1:630)
at com.google.android.gms.internal.ads.zzbbq.onDetachedFromWindow(com.google.android.gms:play-services-ads@@18.1.1:434)
at android.view.View.dispatchDetachedFromWindow(View.java:18583)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3793)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3785)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5375)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5346)
at android.view.ViewGroup.removeView(ViewGroup.java:5277)
at com.google.android.gms.ads.internal.overlay.zze.onDestroy(com.google.android.gms:play-services-ads@@18.1.1:125)
at com.google.android.gms.internal.ads.zzbbq.destroy(com.google.android.gms:play-services-ads@@18.1.1:472)
at com.google.android.gms.internal.ads.zzbbo.destroy(com.google.android.gms:play-services-ads@@18.1.1:106)
at com.google.android.gms.internal.ads.zzbrc.finalize(com.google.android.gms:play-services-ads@@18.1.1:33)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:256)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:243)
at java.lang.Daemons$Daemon.run(Daemons.java:109)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.Throwable: A WebView method was called on thread 'FinalizerDaemon'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 2) {f4f671a} called on null, FYI main Looper is Looper (main, tid 2) {f4f671a})
OS: Android 7.1 , 8.0 , 8.1 , 9.0 are getting same error logs
this issue is mostly caused because you're using interstitial ads. because i had the same issue and google refused any update i made for the app until i "fixed" the issue.
the problem here, is that interstitial ads will try to load also when you exit the app tapping on the home button.
so you have to block the ads from loading when you leave the app.
you can try this (what i have done):
in your activiy/fragment create a field variable, like
private boolean shouldLoadAds
;in your onCreate() you initialise your Interstitial:
and when you call the interstitial to show it, you do it like this:
then you have to override
onStart()
and ononStop()
like this: