mobile-sdk-android
mobile-sdk-android copied to clipboard
Fatal Exception: java.lang.RuntimeException java.lang.Throwable: A WebView method was called on thread 'mqt_native_modules'.
I am getting the following error from AppNexus:
Fatal Exception: java.lang.RuntimeException
java.lang.Throwable: A WebView method was called on thread 'mqt_native_modules'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 2) {94ff67b} called on Looper (mqt_native_modules, tid 197) {3c0cc80}, FYI main Looper is Looper (main, tid 2) {94ff67b})
It happens when the user backgrounds the app. We have AppNexus implemented as a Native Module in React Native and I believe there is some request in AppNexus that gets run when the app is backgrounded on a thread that it's not allowed to which causes the crash. I am having a hard time finding the source of the issue though, what we use is MultiAdRequestListener
to fetch the ads. Anyone has any idea of where the issue could be?
Hi @Bej-Technologies , Please provide following details for us to look into it .
- Full Stacktrace
- Appnexus SDK version that you are using.
- Android Version
Hi @yrajshekhar!
Stacktrace:
Fatal Exception: java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'mqt_native_modules'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 2) {4bbf924} called on Looper (mqt_native_modules, tid 263) {5da52b}, FYI main Looper is Looper (main, tid 2) {4bbf924})
at android.webkit.WebView.checkThread(WebView.java:2615)
at android.webkit.WebView.loadUrl(WebView.java:742)
at com.iab.omid.library.appnexus.b.e.a(:30)
at com.iab.omid.library.appnexus.b.e.a(:30)
at com.iab.omid.library.appnexus.b.e.a(:12)
at com.iab.omid.library.appnexus.publisher.AdSessionStatePublisher.a(:8)
at com.iab.omid.library.appnexus.b.f.a(:30)
at com.iab.omid.library.appnexus.a.d.d(:4)
at com.iab.omid.library.appnexus.a.d.onChange(:15)
at android.database.ContentObserver.onChange(ContentObserver.java:153)
at android.database.ContentObserver.onChange(ContentObserver.java:169)
at android.database.ContentObserver.onChange(ContentObserver.java:187)
at android.database.ContentObserver.onChange(ContentObserver.java:202)
at android.database.ContentObserver.lambda$dispatchChange$0$ContentObserver(ContentObserver.java:282)
at android.database.ContentObserver$$ExternalSyntheticLambda0.run(:10)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:920)
AppNexus SDK version: com.appnexus.opensdk:appnexus-sdk:[7,8)
Android versions are very spread out, see attached screenshot.
Hi @Bej-Technologies, We are unable to replicate on our end. Please share the replication steps along with sample application to replicate the issue.
@yrajshekhar I managed to reproduce it now, it crashes when I press the volume up/down button. Any ideas why that can be?
I'm also trying to fork the library to edit it myself but the build seems to fail? https://jitpack.io/com/github/appnexus/mobile-sdk-android/7.21/build.log
Ping @yrajshekhar
I did some downgrading to see if I could get rid of the issue with older versions of your library and it seems like on version 7.13.1 it starts working. But version 7.14 and up I experience this issue
I am getting the following error from AppNexus:
Fatal Exception: java.lang.RuntimeException java.lang.Throwable: A WebView method was called on thread 'mqt_native_modules'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 2) {94ff67b} called on Looper (mqt_native_modules, tid 197) {3c0cc80}, FYI main Looper is Looper (main, tid 2) {94ff67b})
It happens when the user backgrounds the app. We have AppNexus implemented as a Native Module in React Native and I believe there is some request in AppNexus that gets run when the app is backgrounded on a thread that it's not allowed to which causes the crash. I am having a hard time finding the source of the issue though, what we use is
MultiAdRequestListener
to fetch the ads. Anyone has any idea of where the issue could be?
@Bej-Technologies Going back to initial issue raised here, could you confirm that this issue arises only for MultiAdRequest
. Maybe try using just BannerAdView
/ NativeAdRequest
and see if you are able to replicate the issue with it as well. This will help us narrow down the issue to a certain implementation.
Also, we have upgraded the OMID, can you test your implementation with the latest SDK version, and let us know if the issue is still there.
@Bej-Technologies were you able to test the above-mentioned scenarios? We are waiting for your response on it, to proceed further on our investigation.
We are closing this issue due to inactivity. In case the issue persists, please feel free to reach out Xandr support.