java.lang.NullPointerException:尝试调用虚拟方法“ float android.view.InputDevice $ MotionRange.getMin()”

时间:2019-03-15 12:37:40

标签: android nullpointerexception flutter

每次单击小部件时,我都会收到以下错误消息:

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

我转到另一个项目并收到相同的错误,该错误发生在TextField,按钮和GridList项上。

我认为这可能是SDK中的错误

Flutter: 1.2.1
Dart: 2.2.0

我振奋了一下,现在就收到了。 完整的日志就是它:

 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

新细节: 我可以看到使用镜子(Vysor或ScrCpy)时会发生错误,而当我用手指使用真实手机时,我只能使用该应用程序。

1 个答案:

答案 0 :(得分:2)

当我们使用应用程序在PC上进行镜像时,这是一个Flutter中的Bug,只需要更新Flutter,我使用的是1.3.8,就可以正常工作。