question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attempt to invoke virtual method 'float android.view.MotionEvent.getX()' on a null object reference

See original GitHub issue

It works, but sometimes it shows this error: (Double Tap)

I don’t know how to replicate tho 😕

Process: com.test.testmenu, PID: 5675
                  java.lang.NullPointerException: Attempt to invoke virtual method 'float android.view.MotionEvent.getX()' on a null object reference
                      at com.github.nisrulz.sensey.TouchTypeDetector$a.onScroll(SourceFile:169)
                      at android.view.GestureDetector.onTouchEvent(GestureDetector.java:619)
                      at android.support.v4.view.GestureDetectorCompat$GestureDetectorCompatImplJellybeanMr2.onTouchEvent(GestureDetectorCompat.java:479)
                      at android.support.v4.view.GestureDetectorCompat.onTouchEvent(GestureDetectorCompat.java:542)
                      at com.github.nisrulz.sensey.Sensey.setupDispatchTouchEvent(SourceFile:4102)
                      at com.quarkprojects.detetordeazeite.MainActivity.dispatchTouchEvent(MainActivity.java:1202)
                      at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:71)
                      at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:71)
                      at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
                      at android.view.View.dispatchPointerEvent(View.java:9514)
                      at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4230)
                      at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4096)
                      at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
                      at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
                      at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
                      at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3787)
                      at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
                      at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3844)
                      at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
                      at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
                      at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
                      at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
                      at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
                      at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5922)
                      at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5896)
                      at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5857)
                      at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6025)
                      at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
                      at android.os.MessageQueue.nativePollOnce(Native Method)
                      at android.os.MessageQueue.next(MessageQueue.java:323)
                      at android.os.Looper.loop(Looper.java:135)
                      at android.app.ActivityThread.main(ActivityThread.java:5417)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nisrulzcommented, Feb 28, 2017

Hmm… good to know that. I am closing this issue until it resurfaces again.

0reactions
sebastintocommented, Aug 10, 2021

I don’t know if it’s related but I’ve gotten a couple of somewhat similar crashes. Please let me know if you’d prefer that UI open a new issue for it. See below:

java.lang.NullPointerException: 
  at com.github.nisrulz.sensey.TouchTypeDetector$a.onScroll (SourceFile:1)
  at android.view.GestureDetector.onTouchEvent (GestureDetector.java:650)
  at androidx.core.view.GestureDetectorCompat$GestureDetectorCompatImplJellybeanMr2.onTouchEvent (GestureDetectorCompat.java:480)
  at androidx.core.view.GestureDetectorCompat.onTouchEvent (GestureDetectorCompat.java:543)
  at com.github.nisrulz.sensey.TouchTypeDetector.a (SourceFile:10)
  at com.github.nisrulz.sensey.Sensey.setupDispatchTouchEvent (SourceFile:2)
  at com.tobianoapps.timerise.ui.MainActivity.dispatchTouchEvent (MainActivity.kt:146)
  at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent (WindowCallbackWrapper.java:69)
  at com.android.internal.policy.DecorView.dispatchTouchEvent (DecorView.java:692)
  at android.view.View.dispatchPointerEvent (View.java:13721)
  at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent (ViewRootImpl.java:6197)
  at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:5975)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5424)
  at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5477)
  at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5443)
  at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:5602)
  at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5451)
  at android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:5659)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5424)
  at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5477)
  at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5443)
  at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5451)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5424)
  at android.view.ViewRootImpl.deliverInputEvent (ViewRootImpl.java:8501)
  at android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java:8421)
  at android.view.ViewRootImpl.enqueueInputEvent (ViewRootImpl.java:8374)
  at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent (ViewRootImpl.java:8616)
  at android.view.InputEventReceiver.dispatchInputEvent (InputEventReceiver.java:198)
  at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents (Native Method)
  at android.view.InputEventReceiver.consumeBatchedInputEvents (InputEventReceiver.java:187)
  at android.view.ViewRootImpl.doConsumeBatchedInput (ViewRootImpl.java:8575)
  at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run (ViewRootImpl.java:8643)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:988)
  at android.view.Choreographer.doCallbacks (Choreographer.java:765)
  at android.view.Choreographer.doFrame (Choreographer.java:694)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:967)
  at android.os.Handler.handleCallback (Handler.java:873)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7156)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:975)

Device was a Samsung Galaxy J7 Neo running Android 9 (SDK 28).

Any idea how I could investigate the source of this error? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android: Attempt to invoke virtual method (onTouch) on a null ...
Basically your gDetector must be null and there's an attempt to call its onTouchEvent(...) method causing the NPE. The problem is where you ......
Read more >
Attempt to invoke virtual method 'float android.view ... - Telerik
Java.Lang.NullPointerException: Attempt to invoke virtual method 'float android.view.MotionEvent.getX()' on a null object reference.
Read more >
CoordinatorLayout NPE: java.lang.NullPointerException: Attempt to ...
java.lang.NullPointerException: Attempt to invoke virtual method 'float android.view.MotionEvent.getX()' on a null object reference at android.view.View.
Read more >
VelocityTracker | Android Developers
Retrieve a new VelocityTracker object to watch the velocity of a motion. ... The finalize method is never invoked more than once by...
Read more >
Java – Android: Attempt to invoke virtual method (onTouch) on a null ...
Java – Android: Attempt to invoke virtual method (onTouch) on a null ... getX() - e2. ... MotionEvent)' on a null object reference...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found