google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.31k stars 592 forks source link

scroll observation scope does not exist (0.35.0-alpha) #1778

Open spss20 opened 4 weeks ago

spss20 commented 4 weeks ago

Strange bug in 0.35.0-alpha accompanist version only on pixel devices.

Suddenly one of my production app which was earlier working started to crash in pixel device, the error was as follows

                                                                  java.lang.IllegalStateException: scroll observation scope does not exist
                                                                                                    at androidx.compose.ui.contentcapture.AndroidContentCaptureManager.checkForContentCapturePropertyChanges(AndroidContentCaptureManager.android.kt:332)
                                                                                                    at androidx.compose.ui.contentcapture.AndroidContentCaptureManager.contentCaptureChangeChecker$lambda$0(AndroidContentCaptureManager.android.kt:145)
                                                                                                    at androidx.compose.ui.contentcapture.AndroidContentCaptureManager.$r8$lambda$1XDFQ87DMU0Pr1CSBqiV4PdF6bM(Unknown Source:0)
                                                                                                    at androidx.compose.ui.contentcapture.AndroidContentCaptureManager$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
                                                                                                    at android.os.Handler.handleCallback(Handler.java:959)
                                                                                                    at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                    at android.os.Looper.loopOnce(Looper.java:232)
                                                                                                    at android.os.Looper.loop(Looper.java:317)
                                                                                                    at android.app.ActivityThread.main(ActivityThread.java:8592)
                                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
                                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

I am only using accomponist permissions library to get location permission from user.

To Reproduce

Steps to reproduce the behavior:

  1. Use accompanist version 0.35.0-alpha
  2. Use a vertical lazy column or grid in Jetpack compose
  3. Run the app in any pixel device running latest Android 14
  4. See error "scroll observation scope does not exist" whenever you open the app with lazy layout

Environment:

tripping242 commented 3 weeks ago

Same issue reported on Pixel 7a , Android a4, 0.35.0-alpha here. Downgrading to 0.34.0 prevents the issue for now.

bentrengrove commented 1 week ago

This issue is an issue in the Compose main libraries, not Accompanist. By using the Accompanist alpha you are upgrading your Compose version in your app to the 1.7 alphas.

I will fix this by bumping the minimum Compose version in Accompanist to the 1.7 beta, but as detailed in the readme, you should be using the matching accompanist version for your version of Compose