PSA — I have been seeing a bunch of crashes in CMP...
# jewel
s
PSA — I have been seeing a bunch of crashes in CMP code in my standalone app:
Copy code
java.lang.NullPointerException
        at java.base/java.util.ArrayDeque.addFirst(ArrayDeque.java:284)
        at androidx.compose.ui.platform.a11y.ComposeSceneAccessibility.defaultAccessibilityFocusTarget(ComposeSceneAccessibility.kt:169)
        at androidx.compose.ui.platform.a11y.ComposeSceneAccessibility.onAccessibleReceivedFocus(ComposeSceneAccessibility.kt:86)
        at androidx.compose.ui.platform.a11y.ComposeSceneAccessibility.access$onAccessibleReceivedFocus(ComposeSceneAccessibility.kt:51)
        at androidx.compose.ui.platform.a11y.ComposeSceneAccessibility$onSemanticsOwnerAppended$ownerAccessibility$1.invoke(ComposeSceneAccessibility.kt:99)
        at androidx.compose.ui.platform.a11y.ComposeSceneAccessibility$onSemanticsOwnerAppended$ownerAccessibility$1.invoke(ComposeSceneAccessibility.kt:99)
        at androidx.compose.ui.platform.a11y.SemanticsOwnerAccessibility.onNodeRemoved(SemanticsOwnerAccessibility.kt:169)
        at androidx.compose.ui.platform.a11y.SemanticsOwnerAccessibility.syncNodes$lambda$5$0(SemanticsOwnerAccessibility.kt:411)
        at androidx.compose.ui.platform.a11y.SemanticsOwnerAccessibility.syncNodes(SemanticsOwnerAccessibility.kt:421)
        at androidx.compose.ui.platform.a11y.SemanticsOwnerAccessibility.access$syncNodes(SemanticsOwnerAccessibility.kt:60)
        at androidx.compose.ui.platform.a11y.SemanticsOwnerAccessibility$launchSyncLoop$1$1.invokeSuspend(SemanticsOwnerAccessibility.kt:355)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:323)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:732)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:711)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
This is a known bug in CMP and was fixed in CMP 1.12.0-beta02. The next Jewel version, 0.40, will move to CMP 1.12.0-beta02 or higher, but in the meantime if you experience that issue too, you may want to do the update on your own. Jewel should work fine with 1.12. For more details see this PR
s
The fix is very simple. Hopefully they apply it to the 1.11 line. Personally, I can't update to 1.12 because of other bugs. youtrack.jetbrains.com/issue/CMP-10170/NPE-crash-in-A11Y-subsystem You can work around this by disabling a11y on mac.
jvmArgs += "-Dcompose.accessibility.enable=false"
s
@Alexander Maryanovsky do you know if the fix will be backported?
a
I’m not sure if we’ll be doing more 1.11 releases. We can if it’s important.
What’s preventing you from upgrading to 1.12, Sean?
s
A SelectionContainer/LazyColumn bug. I didn't get around to making repro yet. I think any click that isn't on an item in the LazyColumn inside a SelectionContainer (padding or space below the last element) crashes in 1.12.
a
Please do submit a reproducer; I’ll take a look at it ASAP
s
Thanks. Will do. I'll get to it later today or tomorrow.
a
Thanks
a
Thanks
s
@Alexander Maryanovsky fwiw the a11y crash is very persistent in 1.11, I'd recommend a hotfix