I am running into an issue where my compose wear a...
# compose-wear
t
I am running into an issue where my compose wear app crashes with a NullPointerException when navigating between screens using the wear compose navigation library. Found an already reported issue here: https://issuetracker.google.com/issues/206677462. Could someone please look into this? This is currently blocking me from using compose on Wear OS.
y
From the bug it seems a general compose issue on specific mobile + wear devices. Do you think there is a wear specific code path causing it?
t
Well in my project it happens when navigating between screens using wear navigation compose. I still need to look into it further what exactly is the issue. I was hoping someone (from Google) could maybe look into it or provide a workaround. I am not that familiar with the compose internals.
y
Hopefully they will. Is there a simple repro for wear? I didn't notice one immediately on the bug.
j
@Steve Bower [G] can you take a look
s
Hi Thomas - would you be able to share a cutdown sample app that shows the problem? The other sample shared in the bug isn't using Wear Compose (and doesn't reference androidx.navigation). Also, does this only occur on the Samsung Galaxy 4 (have you tried it on other Wear devices)?
t
Hi Steve, I am trying to create a sample app but so far I was unsuccessful. The crash seems to be caused by a combination of wear composables (and normal compose) on multiple screens. Still trying to find the cause, but it is quite difficult. I was unable to reproduce the issue on a Michael Kors Access Runway Gen 4. So only the Samsung watch so far.
The screens are built primarily using Scaffold and ScalingLazyColumn
Just found out that removing PositionIndicator from my code completely fixes the issue. However, the issue does not reproduce on every screen using PositionIndicator, so am still unable to create a sample project.
To be precise, the app crashes when swiping back from a screen which has a PositionIndicator (and Scaffold, ScalingLazyColumn) to another screen. Remove the PositionIndicator and the issue is gone.
I would like to get this fixed but so far I am unable to create a sample project. Do you have any ideas @Steve Bower [G]?
s
Hi Thomas - I haven't seen this error in any other testing, so would really need access to some Wear Compose code that triggers it. Meanwhile, I am following up offline with graphics experts to take a look at the original bug that you've linked.
t
Thanks, I will keep looking into it. I hope that if the original bug is fixed that it fixes the Wear issue I am experiencing as well.
Hi @Steve Bower [G], I can confirm that the latest AndroidX snapshots are working again for me. So the fix linked from the issue is working. Thanks for the help, now I can start rolling out my new Wear app to beta.
🦜 2