Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Firebase issue: PlatformViewWrapper.draw - java.lang.IllegalStateException - Surface was already locked! - PlatformViewWrapper.java:300 #1855

Open
2 tasks done
HAFIZkhan-source opened this issue Nov 2, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@HAFIZkhan-source
Copy link

  • I have read the Getting Started section
  • I have already searched for the same problem

Environment

Technology Version
Flutter version 3.7.12
Plugin version 5.8.0
Android version 6, 11, 12, 13
iOS version
macOS version
Xcode version

Device information: Samsung Galaxy J2 Pro, vivo, Xiomi

Stacktrace/Logcat

Fatal Exception: java.lang.IllegalStateException: Surface was already locked!
at android.view.Surface$HwuiContext.lockCanvas(Surface.java:648)
at android.view.Surface.lockHardwareCanvas(Surface.java:365)
at io.flutter.plugin.platform.PlatformViewWrapper.draw(PlatformViewWrapper.java:300)
at android.view.View.updateDisplayListIfDirty(View.java:16519)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3910)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3890)
at android.view.View.updateDisplayListIfDirty(View.java:16479)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3910)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3890)
at android.view.View.updateDisplayListIfDirty(View.java:16479)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3910)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3890)
at android.view.View.updateDisplayListIfDirty(View.java:16479)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3910)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3890)
at android.view.View.updateDisplayListIfDirty(View.java:16479)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3910)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3890)
at android.view.View.updateDisplayListIfDirty(View.java:16479)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:325)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:331)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:366)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3234)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3033)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2615)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1528)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7530)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:622)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

java.lang.ProcessManager:
at java.lang.Object.wait(Object.java)
at java.lang.ProcessManager.waitForMoreChildren(ProcessManager.java:140)
at java.lang.ProcessManager.watchChildren(ProcessManager.java:105)
at java.lang.ProcessManager.-wrap0(ProcessManager.java)
at java.lang.ProcessManager$1.run(ProcessManager.java:58)

pool-21-thread-1:
at java.lang.Object.wait(Object.java)
at java.lang.Thread.parkFor$(Thread.java:1220)
at sun.misc.Unsafe.park(Unsafe.java:299)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2013)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1078)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1071)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1038)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1098)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

ReferenceQueueDaemon:
at java.lang.Object.wait(Object.java)
at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:162)
at java.lang.Thread.run(Thread.java:818)

AsyncTask #3:
at java.lang.Object.wait(Object.java)
at java.lang.Thread.parkFor$(Thread.java:1220)
at sun.misc.Unsafe.park(Unsafe.java:299)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2013)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:410)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1038)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1098)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

PlatformServiceBridgeHandlerThread:
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)

OkHttp TaskRunner:
at java.lang.Object.wait(Object.java)
at okhttp3.internal.concurrent.TaskRunner$RealBackend.coordinatorWait(TaskRunner.kt:294)
at okhttp3.internal.concurrent.TaskRunner.awaitTaskToRun(TaskRunner.kt:218)
at okhttp3.internal.concurrent.TaskRunner$runnable$1.run(TaskRunner.kt:59)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

@HAFIZkhan-source HAFIZkhan-source added the bug Something isn't working label Nov 2, 2023
Copy link

github-actions bot commented Nov 2, 2023

👋 @HAFIZkhan-source

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

@HAFIZkhan-source
Copy link
Author

Yes, I have searched and then submitted the issue

@HAFIZkhan-source
Copy link
Author

Any update on this?

Please see this on priority. Many app users are facing this issue

@pichillilorenzo
Copy link
Owner

Have you tried to upgrade Flutter version and the plugin version to 6?

@viktor-savchik-idf
Copy link

@pichillilorenzo we have the same issue it is top 1 of our crashes in the app and yes we updated the plugin version to 6 and using the new version of Flutter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants