Repository navigation
Description
E/MethodChannel#flutter/platform_views: Failed to handle method call
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.mapbox.android.gestures.MoveDistancesObject.addNewPosition(float, float)' on a null object reference
at com.mapbox.android.gestures.MoveGestureDetector.updateMoveDistancesObjects(MoveGestureDetector.java:172)
at com.mapbox.android.gestures.MoveGestureDetector.analyzeMovement(MoveGestureDetector.java:147)
at com.mapbox.android.gestures.MultiFingerGesture.analyzeEvent(MultiFingerGesture.java:106)
at com.mapbox.android.gestures.ProgressiveGesture.analyzeEvent(ProgressiveGesture.java:55)
at com.mapbox.android.gestures.MoveGestureDetector.analyzeEvent(MoveGestureDetector.java:141)
at com.mapbox.android.gestures.BaseGesture.analyze(BaseGesture.java:61)
at com.mapbox.android.gestures.BaseGesture.onTouchEvent(BaseGesture.java:39)
at com.mapbox.android.gestures.AndroidGesturesManager.onTouchEvent(AndroidGesturesManager.java:193)
at com.mapbox.mapboxgl.MapboxMapController$1.onTouch(MapboxMapController.java:199)
at android.view.View.dispatchTouchEvent(View.java:13479)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3082)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2767)
at io.flutter.plugin.platform.PlatformViewsController$1.onTouch(PlatformViewsController.java:313)
at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.touch(PlatformViewsChannel.java:176)
at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:68)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296)
at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:320)
at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$TsixYUB5E6FpKhMtCSQVHKE89gQ.run(Unknown Source:12)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7562)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'void com.mapbox.android.gestures.MoveDistancesObject.addNewPosition(float, float)' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'void com.mapbox.android.gestures.MoveDistancesObject.addNewPosition(float, float)' on a null object reference
at com.mapbox.android.gestures.MoveGestureDetector.updateMoveDistancesObjects(MoveGestureDetector.java:172)
at com.mapbox.android.gestures.MoveGestureDetector.analyzeMovement(MoveGestureDetector.java:147)
at com.mapbox.android.gestures.MultiFingerGesture.analyzeEvent(MultiFingerGesture.java:106)
at com.mapbox.android.gestures.ProgressiveGesture.analyzeEvent(ProgressiveGesture.java:55)
at com.mapbox.android.gestures.MoveGestureDetector.analyzeEvent(MoveGestureDetector.java:141)
at com.mapbox.android.gestures.BaseGesture.analyze(BaseGesture.java:61)
at com.mapbox.android.gestures.BaseGesture.onTouchEvent(BaseGesture.java:39)
at com.mapbox.android.gestures.AndroidGesturesManager.onTouchEvent(AndroidGesturesManager.java:193)
at com.mapbox.mapboxgl.MapboxMapController$1.onTouch(MapboxMapController.java:199)
at android.view.View.dispatchTouchEvent(View.java:13479)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3082)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2767)
at io.flutter.plugin.platform.PlatformViewsController$1.onTouch(PlatformViewsController.java:313)
at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.touch(PlatformViewsChannel.java:176)
at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:68)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296)
at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:320)
at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$TsixYUB5E6FpKhMtCSQVHKE89gQ.run(Unknown Source:12)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7562)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:177:18)
<asynchronous suspension>
#2 AndroidViewController.sendMotionEvent (package:flutter/src/services/platform_views.dart:803:5)
<asynchronous suspension>
#3 AndroidViewController.dispatchPointerEvent (package:flutter/src/services/platform_views.dart:895:7)
<asynchronous suspension>
flutter doctor result
[✓] Flutter (Channel stable, 2.10.3, on macOS 12.2.1 21D62 darwin-arm, locale en-TR)
• Flutter version 2.10.3 at /Users/tolgamini/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7e9793dee1 (4 weeks ago), 2022-03-02 11:23:12 -0600
• Engine revision bd539267b4
• Dart version 2.16.1
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/tolgamini/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
[✓] VS Code (version 1.65.2)
• VS Code at /Volumes/Seagate/Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.36.0
[✓] Connected device (2 available)
• Redmi Note 9S (mobile) • 73a631d6 • android-arm64 • Android 10 (API 29)
• Chrome (web) • chrome • web-javascript • Google Chrome 99.0.4844.83
[✓] HTTP Host Availability
• All required HTTP hosts are available
Activity
felix-ht commentedon Mar 27, 2022
Quite strange - what's the version of mapbox?
GULERTOLGA commentedon Mar 27, 2022
From the master branch.
I've been using mapbox for a very long time. I can say that this problem has just started to occur. I looked at the bug reports of the application in production (using 0.14.0), but I did not come across such a situation.
GULERTOLGA commentedon Mar 27, 2022
Could it be a problem with Flutter passing Gestures?
GULERTOLGA commentedon Mar 27, 2022
GULERTOLGA commentedon Mar 27, 2022
@felix-ht
The error does not repeat if I set the useHybridComposition property to false. I'm not so sure, but after making this change, I didn't get any errors. When I set it to true again, I get the error within a few minutes.
The Android version of the device is 10.
felix-ht commentedon Mar 28, 2022
might very well be caused by hybrid composition - @yoavrofe any ideas?
felix-ht commentedon Mar 28, 2022
@Chaoba this feels like an upstream bug?
felix-ht commentedon Mar 28, 2022
@GULERTOLGA you can set
dragEnabled: falseto MapboxMap to get rid of the issue. This is only possible if you don't use drag and drop.Chaoba commentedon Mar 30, 2022
Guess no, we didn't see such error in upstream.
chuyentt commentedon Mar 30, 2022
Same here. Also, I measured the distance and area on Android was wrong while on iOS it looks right.
I used the latest version on git
stale commentedon May 29, 2022
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.