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.

java.lang.NullPointerException in com.badlogic.gdx.backends.android.AndroidMouseHandler.onGenericMotion

See original GitHub issue

I got crash on Lenovo(A880), android 4.2

Issue details

java.lang.NullPointerException at com.badlogic.gdx.backends.android.AndroidMouseHandler.onGenericMotion(AndroidMouseHandler.java:62) at com.badlogic.gdx.backends.android.AndroidInputThreePlus.onGenericMotion(AndroidInputThreePlus.java:47) at android.view.View.dispatchGenericMotionEventInternal(View.java:7415) at android.view.View.dispatchGenericMotionEvent(View.java:7402) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:1799) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1533) at android.view.View.dispatchGenericMotionEvent(View.java:7392) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:1799) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1533) at android.view.View.dispatchGenericMotionEvent(View.java:7392) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:1799) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1533) at android.view.View.dispatchGenericMotionEvent(View.java:7392) at android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:1799) at android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1533) at android.view.ViewGroup.exitHoverTargets(ViewGroup.java:1615) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2613) at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:2997) at android.view.ViewRootImpl.doDie(ViewRootImpl.java:4598) at android.view.ViewRootImpl.die(ViewRootImpl.java:4578) at android.view.WindowManagerGlobal.removeViewLocked(WindowManagerGlobal.java:338) at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:288) at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:84) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3790) at android.app.ActivityThread.access$1200(ActivityThread.java:165) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1426) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5476) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) at dalvik.system.NativeStart.main(Native Method)

Version of LibGDX and/or relevant dependencies

1.9.3-SNAPSHOT

Please select the affected platforms

  • Android

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Tom-Skicommented, Apr 12, 2016

Closed #4013 as it is a duplicate issue. Seems like handleDestroyActivity is called after destroy is called, so the change https://github.com/libgdx/libgdx/commit/5498c2f32a1f45c9b1e4303be5a70da0dc7dba95 causes these NPEs.

0reactions
little-dgekcommented, May 26, 2016

Hi. On LibGDX 1.9.3 NPE was returned.

java.lang.NullPointerException
com.badlogic.gdx.backends.android.AndroidMouseHandler.onGenericMotion(Unknown Source)
                                                      postTouchEvent
com.badlogic.gdx.backends.android.AndroidInputThreePlus.onGenericMotion(Unknown Source)
android.view.View.dispatchGenericMotionEventInternal(View.java:7481)
android.view.View.dispatchGenericMotionEvent(View.java:7468)
android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:1822)
android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1556)
android.view.View.dispatchGenericMotionEvent(View.java:7458)
android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:1822)
android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1556)
android.view.View.dispatchGenericMotionEvent(View.java:7458)
android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:1822)
android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1556)
android.view.View.dispatchGenericMotionEvent(View.java:7458)
android.view.ViewGroup.dispatchTransformedGenericPointerEvent(ViewGroup.java:1822)
android.view.ViewGroup.dispatchHoverEvent(ViewGroup.java:1556)
android.view.ViewGroup.exitHoverTargets(ViewGroup.java:1638)
android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2558)
android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:2844)
android.view.ViewRootImpl.doDie(ViewRootImpl.java:5188)
android.view.ViewRootImpl.die(ViewRootImpl.java:5171)
android.view.WindowManagerGlobal.removeViewLocked(WindowManagerGlobal.java:359)
android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:309)
android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:84)
android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3782)
android.app.ActivityThread.access$1500(ActivityThread.java:148)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1372)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:137)
android.app.ActivityThread.main(ActivityThread.java:5473)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:525)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:854)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
dalvik.system.NativeStart.main(Native Method)
Read more comments on GitHub >

github_iconTop Results From Across the Web

ava.lang.NullPointerException in com.badlogic.gdx.backends ...
I got crash on Galaxy Ace2 (GT-I8160), android 2.3.3-2.3.7 Issue details java.lang.NullPointerException at com.badlogic.gdx.backends.android ...
Read more >
Libgdx NullPointerException - java - Stack Overflow
NullPointer exception means you are trying to use something that has not been initialized yet. Objects, arrays and variables must be initialized/assigned a ......
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
Anybody working in java must have seen this popping out of nowhere in the java standalone program as well as the java web...
Read more >
Getting Help - libGDX
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.NullPointerException at com.badlogic.gdx.backends.lwjgl.
Read more >
Undetected Null Pointer Exception in TextureRegions
I have an error regarding Null Pointer Exception and I can't find the exact location of the error in my program. I have...
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