java.lang.NullPointerException: Attempt to invoke virtual method 'float android.view.InputDevice$MotionRange.getMin()'

1,381

This is a Bug in flutter when we use a app to mirror in the PC, just need to update the Flutter, I'm using the 1.3.8 and work fine.

Share:
1,381
Siloé Bezerra Bispo
Author by

Siloé Bezerra Bispo

I'm a developer focused in mobile development, I plan, design, create and manage development for apps. Currently using Flutter. software developer since 2009

Updated on December 10, 2022

Comments

  • Siloé Bezerra Bispo
    Siloé Bezerra Bispo over 1 year

    I receive the error below every time I click in a Widget :

    java.lang.NullPointerException: Attempt to invoke virtual method 'float android.view.InputDevice$MotionRange.getMin()' on a null object reference
    

    I change to another project and receive the same error, the error happens with a TextField, a button and a item of GridList.

    I think that can be a error in a sdk

    Flutter: 1.2.1
    Dart: 2.2.0
    

    I upgraded my flutter and receiving this now. The complete log is it:

     Shutting down VM E/AndroidRuntime(26099): FATAL EXCEPTION: main
     E/AndroidRuntime(26099): Process: videira.com.videiralideres, PID:
     26099 E/AndroidRuntime(26099): java.lang.NullPointerException: Attempt
     to invoke virtual method 'float
     android.view.InputDevice$MotionRange.getMin()' on a null object
     reference E/AndroidRuntime(26099):     at
     io.flutter.view.FlutterView.addPointerForIndex(FlutterView.java:480)
     E/AndroidRuntime(26099):   at
     io.flutter.view.FlutterView.onTouchEvent(FlutterView.java:542)
     E/AndroidRuntime(26099):   at
     android.view.View.dispatchTouchEvent(View.java:11779)
     E/AndroidRuntime(26099):   at
     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
     E/AndroidRuntime(26099):   at
     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2600)
     E/AndroidRuntime(26099):   at
     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
     E/AndroidRuntime(26099):   at
     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2600)
     E/AndroidRuntime(26099):   at
     android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2971)
     E/AndroidRuntime(26099):   at
     android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2600)
     E/AndroidRuntime(26099):   at
     com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:477)
     E/AndroidRuntime(26099):   at
     com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1835)
     E/AndroidRuntime(26099):   at
     android.app.Activity.dispatchTouchEvent(Activity.java:3326)
     E/AndroidRuntime(26099):   at
     com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:439)
     E/AndroidRuntime(26099):   at
     android.view.View.dispatchPointerEvent(View.java:12018)
     E/AndroidRuntime(26099):   at
     android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4829)
     E/AndroidRuntime(26099):   at
     android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4643)
     E/AndroidRuntime(26099):   at
     android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4181)
     E/AndroidRuntime(26099):   at
    

    New Detail: I can see that error happens when I use a mirror (Vysor or ScrCpy), I just can use the app when I use the real phone with my fingers.