"java.lang.IllegalStateException: Cannot perform this action on a sealed instance." FATAL EXCEPTION: main
Asked Answered
L

1

6

I am getting this error on pre-launch report from playstore console. I am not able to generate this crash on any real device I try. The device from pre-launch report is Samsung s9 (Android 8.0).

This is the stacktrace :

FATAL EXCEPTION: main
java.lang.IllegalStateException: Cannot perform this action on a sealed instance.
    at android.view.accessibility.AccessibilityNodeInfo.enforceNotSealed(AccessibilityNodeInfo.java:2992)
    at android.view.accessibility.AccessibilityNodeInfo.setSource(AccessibilityNodeInfo.java:818)
    at android.view.accessibility.AccessibilityNodeInfo.setSource(AccessibilityNodeInfo.java:795)
    at android.view.accessibility.AccessibilityNodeInfo.obtain(AccessibilityNodeInfo.java:3008)
    at android.view.View.createAccessibilityNodeInfoInternal(View.java:7897)
    at android.view.View.createAccessibilityNodeInfo(View.java:7883)
    at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1051)
    at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:876)
    at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:199)
    at android.view.AccessibilityInteractionController.-wrap1(Unknown Source:0)
    at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1225)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6938)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Lowrie answered 4/8, 2021 at 10:47 Comment(2)
Dont know how much its helps but I added webView.setAccessibilityDelegate(new View.AccessibilityDelegate()); this in my webview and the error went away from playstore.Lowrie
Hi Bipin, where did you add this line?Irving
H
0

Without seeing more code, I'd recommend looking through the following links to try and determine an exact cause.

https://mcmap.net/q/1373355/-java-lang-illegalstateexception-cannot-perform-this-action-on-a-not-sealed-instance

When updating values for AccessibilityNodeInfo it has been seen that calling .getClassName() to see if the value is NULL can help prevent this error.

https://mcmap.net/q/946518/-quot-cannot-perform-this-action-on-a-not-sealed-instance-quot-java-lang-illegalstateexception-exception

Similar to the previous, If you are changing the text of an accessibilityNodeInfo you can check to see if it's sealed by calling isSealed(). on the AccessibilityNodeInfo object

Haynie answered 22/1, 2022 at 17:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.