NPE In BottomSheetBehavior ViewDragHelper
See original GitHub issueDescription: Crash (see logs below)
Expected behavior: Not to crash
Android API version: 8.1.0
Material Library version: com.google.android.material:material:1.2.0-alpha06
Device: Moto G (5) Plus
More Info: From Android issue tracker:
Looks like this is in https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java#L512 which should be filed on https://github.com/material-components/material-components-android/issues
There’s already a null check earlier in that method at https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java#L498 so probably the same defensive check needs to be done everywhere viewDragHelper is used. Going to close this here - please refile in the Github tracker.
V8
is the obfuscated name of ViewDragHelper, and b
is mTouchSlop
.
Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'int V8.b' on a null object reference
at androidx.customview.widget.ViewDragHelper.getTouchSlop(ViewDragHelper.java:503)
at com.google.android.material.bottomsheet.BottomSheetBehavior.onTouchEvent(BottomSheetBehavior.java:512)
at androidx.coordinatorlayout.widget.CoordinatorLayout.performIntercept(CoordinatorLayout.java:505)
at androidx.coordinatorlayout.widget.CoordinatorLayout.onTouchEvent(CoordinatorLayout.java:557)
at android.view.View.dispatchTouchEvent(View.java:11779)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2965)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2643)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:477)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1835)
at android.app.Activity.dispatchTouchEvent(Activity.java:3326)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:1)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:439)
at android.view.View.dispatchPointerEvent(View.java:12018)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4829)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4643)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4181)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4234)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4200)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4327)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4208)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4384)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4181)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4234)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4200)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4208)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4181)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6744)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6683)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6644)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6847)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:193)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:325)
at android.os.Looper.loop(Looper.java:142)
at android.app.ActivityThread.main(ActivityThread.java:6626)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Nope, this will be in the next 1.3.0
Did this make it into 1.2.0?