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

[BottomSheetNavigator] NullPointerException (race-condition?) when using back button #1733

Closed
alixwar opened this issue Dec 6, 2023 · 6 comments

Comments

@alixwar
Copy link

alixwar commented Dec 6, 2023

Describe the bug

This is a crash reported from an analytics tool so I cannot give more details than the stacktrace and the devices where the issues were found.

To Reproduce

Steps to reproduce the behavior:

Fatal Exception: java.lang.NullPointerException:
       at com.google.accompanist.navigation.material.BottomSheetNavigator$sheetContent$1$2.invoke(BottomSheetNavigator.kt:224)
       at com.google.accompanist.navigation.material.BottomSheetNavigator$sheetContent$1$2.invoke(BottomSheetNavigator.kt:223)
       at androidx.activity.compose.BackHandlerKt$BackHandler$backCallback$1$1.handleOnBackPressed(BackHandler.kt:89)
       at androidx.activity.OnBackPressedDispatcher.onBackPressed(OnBackPressedDispatcher.kt:276)
       at androidx.activity.OnBackPressedDispatcher$5.invoke(OnBackPressedDispatcher.kt:134)
       at androidx.activity.OnBackPressedDispatcher$5.invoke(OnBackPressedDispatcher.kt:134)
       at androidx.activity.OnBackPressedDispatcher$Api33Impl.createOnBackInvokedCallback$lambda$0(OnBackPressedDispatcher.kt:369)
       at android.view.ViewRootImpl$NativePreImeInputStage.onProcess(ViewRootImpl.java:7558)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7213)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:10788)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:10676)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:10632)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:10926)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:285)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:335)
       at android.os.Looper.loopOnce(Looper.java:186)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8757)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067) 

Expected behavior

A clear and concise description of what you expected to happen.

Environment:

  • Android OS version: 13
  • Device: Samsung Galaxy A24
  • Accompanist version: 0.32.0

Additional context

Add any other context about the problem here.

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale Stale issues which are marked for closure label Jan 21, 2024
@lildeeOg
Copy link

lildeeOg commented Jan 23, 2024

Any update on this? I also see this one in crashlytics on multiple devices/os

@github-actions github-actions bot removed the stale Stale issues which are marked for closure label Jan 24, 2024
@luisccm
Copy link

luisccm commented Jan 26, 2024

Same here, this one in happening on multiple devices/os

@ZhaohuaZeng-at
Copy link

I also see a similar crash and paste the stacktrace here


                                                                                                    java.lang.NullPointerException
                                                                                                    	at com.google.accompanist.navigation.material.BottomSheetNavigator$sheetContent$1$2.invoke(BottomSheetNavigator.kt:191)
                                                                                                    	at com.google.accompanist.navigation.material.BottomSheetNavigator$sheetContent$1$2.invoke(BottomSheetNavigator.kt:190)
                                                                                                    	at androidx.activity.compose.BackHandlerKt$BackHandler$backCallback$1$1.handleOnBackPressed(BackHandler.kt:89)
                                                                                                    	at androidx.activity.OnBackPressedDispatcher.onBackPressed(OnBackPressedDispatcher.kt:276)
                                                                                                    	at androidx.activity.ComponentActivity.onBackPressed(ComponentActivity.java:678)
                                                                                                    	at android.app.Activity.onKeyUp(Activity.java:3921)
                                                                                                    	at android.view.KeyEvent.dispatch(KeyEvent.java:2925)
                                                                                                    	at android.app.Activity.dispatchKeyEvent(Activity.java:4264)
                                                                                                    	at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:120)
                                                                                                    	at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:85)
                                                                                                    	at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:138)
                                                                                                    	at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:604)
                                                                                                    	at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:60)
                                                                                                    	at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3413)
                                                                                                    	at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:402)
                                                                                                    	at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6708)
                                                                                                    	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6574)
                                                                                                    	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6034)
                                                                                                    	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6091)
                                                                                                    	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6057)
                                                                                                    	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6222)
                                                                                                    	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6065)
                                                                                                    	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6279)
                                                                                                    	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6038)
                                                                                                    	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6091)
                                                                                                    	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6057)
                                                                                                    	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6065)
                                                                                                    	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6038)
                                                                                                    	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6091)
                                                                                                    	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6057)
                                                                                                    	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6255)
                                                                                                    	at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:6435)
                                                                                                    	at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3649)
                                                                                                    	at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:3169)
                                                                                                    	at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:3160)
                                                                                                    	at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3626)
                                                                                                    	at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:154)
                                                                                                    	at android.os.MessageQueue.nativePollOnce(Native Method)
                                                                                                    	at android.os.MessageQueue.next(MessageQueue.java:335)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:161)
                                                                                                    	at android.os.Looper.loop(Looper.java:288)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:7918)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

we are on accompanist 0.34.0
device is pixel 6a, Android version 13

@LluisFelip
Copy link

Attempting to fix this here 🙏🏼

@ianhanniballake
Copy link
Collaborator

With the release of Compose Material 1.7.0-alpha04, the Material team has added a new artifact: androidx.compose.material:material-navigation, which fully replaces Accompanist Navigation Material.

As such, we are closing all issues here on Accompanist and will be fully deprecating Accompanist Navigation Material in an upcoming release.

A number of issues were fixed as part of the migration, but if you're still seeing an issue, please file an issue with a sample project that reproduces your issue and the Material team will take a look.

@ianhanniballake ianhanniballake closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants