miguelhincapie/CustomBottomSheetBehavior

crash with compile sdk version

panospyrakis opened this issue · 6 comments

I get this crash when i updated compile sdk version.

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.ViewDragHelper.processTouchEvent(android.view.MotionEvent)' on a null object reference
        at com.mahc.custombottomsheetbehavior.BottomSheetBehaviorGoogleMapsLike.onTouchEvent(BottomSheetBehaviorGoogleMapsLike.java:288)
        at android.support.design.widget.CoordinatorLayout.resetTouchBehaviors(CoordinatorLayout.java:396)
        at android.support.design.widget.CoordinatorLayout.onAttachedToWindow(CoordinatorLayout.java:238)
        at android.view.View.dispatchAttachedToWindow(View.java:16718)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3151)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3158)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3158)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3158)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3158)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3158)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1823)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1537)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:959)
        at android.view.Choreographer.doCallbacks(Choreographer.java:734)
        at android.view.Choreographer.doFrame(Choreographer.java:670)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:945)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6776)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

i have the same problem how do I solve it ? which compile version is supported?

Adding
if (mViewDragHelper == null) { mViewDragHelper = ViewDragHelper.create(parent, mDragCallback); }

before to the call on the onTouchEvent() would be the workaround for now.

mViewDragHelper.processTouchEvent( event );

can you upload "BottomSheetBehaviorGoogleMapsLike.java" file ? i put this code in line 274 but nothing change !!
i really confused :(
can you guide me ? please

thanks really

Hi @mrmosi13,

I'm sorry but I really don't understand what are you talking about. Can you give me more details please?
A list of things, let me know if this can help you:

  1. I thought I had uploaded last merge code in bintray, am I wrong?
  2. Do you import the library using gradle? Instruction about how to do it are in readme file or main page of this project.
  3. this issue was about an error compiling after switch sdk version, I mean the library was working fine in previous sdk versions but when you upgraded it, it was crashing, do you have same problem?

im having this same issue, any solution?

@mamomia it should be fixed with the latest version, are you using the latest one?