'Any idea what can cause an ANR on android.graphics.HardwareRenderer.nSyncAndDrawFrame?

I've seen a few questions already answered about this but they are all very outdated (like they talk about very old WebView versions).

My app does use the WebView as it is a browser and it also has ads and they typically use the WebView as well. It also uses ExoPlayer and I think some ads are shown with ExoPlayer as well. Unfortunately I don't have any details of when these ANRs are happening but I do know they are happening a lot more since switching ad mediation to a different company.

I've seen suggestions for disabling hardware acceleration but I don't understand why or when to do that? To me it feels like hardware acceleration would be a good thing?

This is the stacktrace for the ANR:

main (native): tid=1 systid=7983
#00 pc 0x7590c libc.so 
#01 pc 0x795f8 libc.so 
#02 pc 0xda55c libc.so 
#03 pc 0x327d54 libhwui.so 
#04 pc 0x30a2dc libhwui.so 
       at android.graphics.HardwareRenderer.nSyncAndDrawFrame(HardwareRenderer.java)
       at android.graphics.HardwareRenderer.syncAndDrawFrame(HardwareRenderer.java:436)
       at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:658)
       at android.view.ViewRootImpl.draw(ViewRootImpl.java:4664)
       at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4375)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3585)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2340)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9057)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1040)
       at android.view.Choreographer.doCallbacks(Choreographer.java:864)
       at android.view.Choreographer.doFrame(Choreographer.java:791)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1025)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:255)
       at android.app.ActivityThread.main(ActivityThread.java:8212)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source