Closed ThexXTURBOXx closed 3 years ago
@ThexXTURBOXx
Can you provide flutter doctor -v
? Also location
is a 3rd party plugin. Can you remove location plugin code and try again to see if you still get exception ?
Thanks.
location
:As I already said, this issue also affects the example app at this specific commit (the newest one) as well, which doesn't have the location
plugin installed.
flutter doctor -v
:It should be worth noting, that I am also affected by https://github.com/flutter/flutter/issues/11940 and have not applied any workaround or whatsoever (the flutter and dart plugins are installed of course in Android Studio)
[✓] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.19042.610], locale de-DE)
• Flutter version 1.22.3 at G:\Programme\Flutter_SDK
• Framework revision 8874f21e79 (4 days ago), 2020-10-29 14:14:35 -0700
• Engine revision a1440ca392
• Dart version 2.10.3
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at G:\Programme\Android_SDK
• Platform android-30, build-tools 30.0.2
• Java binary at: G:\Programme\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6858069\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[!] Android Studio (version 4.1.0)
• Android Studio at G:\Programme\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6858069
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[✓] Connected device (1 available)
• Mi 9T Pro (mobile) • 4d243599 • android-arm64 • Android 10 (API 29)
! Doctor found issues in 1 category.
@ThexXTURBOXx
Tested with official google_maps_flutter
plugin using Android 8.1.0 device on latest stable and used 3 and 4 fingers simultaneously to drag the map, but didn't see the issue. The map scrolled and moved properly.
Can you check if this is only happening on specific device you have or on other emulators too ? Thanks.
Also tested on COL-L29 (Honor 10) with Android 9, EMUI 9.1.0. Same exception: https://pastebin.com/pbKz4ZJG
How can I simulate a three-finger gesture in the emulator or is that even possible?
@ThexXTURBOXx That was my bad to suggest to try on emulator, didn't realize that :-) Anyways, I also tried on Samsung S10+ device but didn't see the issue nor the exception in the log.
Since I don't have the devices you mentioned, I am not sure if it's happening only on the said specific devices. Can you provide video of the issue ?
No problem, okay :)
Interesting, maybe it is related to my devices using a custom Android flavor (Honor 10 uses EMUI, Mi 9T Pro uses MIUI). I uploaded a video of the issue here: https://www.youtube.com/watch?v=38tWaMTFqEQ I hope, that this is sufficient. If not, I can record more parts of the issue or something separately again.
I am unable to replicate the issue using gestures (multiple fingers at once to scroll), but per author and video, it seem to be happening consistently. Keeping this issue open for further analysis.
Thanks for investigating this issue. I also updated my original report to include the additional information of this thread. I hope this helps in further analysis.
I'm facing totally same exception. Trigger of exception is not same as you. But this might be hint to solve this problem. https://github.com/AndreHaueisen/flushbar/issues/161
@takinok Which device and firmware/Android version are you using? This may help investigating the issue further.
@takinok Which device and firmware/Android version are you using? This may help investigating the issue further. I updated my post. Please check following. https://github.com/AndreHaueisen/flushbar/issues/161
Thank you, updated also the issue
I'm facing totally same exception on Redmi Note 6 Pro (tulip)
For those who are facing this issue, Please follow
https://stackoverflow.com/questions/54280541/google-map-in-flutter-not-responding-to-touch-events
body: ListView(
itemExtent: Get.size.height - Get.statusBarHeight,
children: [
GoogleMap(
onMapCreated: _onMapCreated,
initialCameraPosition: CameraPosition(
target: LatLng(51.608800, 0.122630),
),
gestureRecognizers: Set()
..add(Factory<PanGestureRecognizer>(() => PanGestureRecognizer()))
..add(Factory<ScaleGestureRecognizer>(
() => ScaleGestureRecognizer()))
..add(Factory<TapGestureRecognizer>(() => TapGestureRecognizer()))
..add(Factory<VerticalDragGestureRecognizer>(
() => VerticalDragGestureRecognizer())),
),
],
),
itemExtent: ScreenHeight - statusBarHeight
Adding gesture recognizers didn't help in my case, unfortunately. However, thank you for trying to help :)
Hey can wrap map in listview list just like i did in above comment, Try it because i have also faced same issue but after wrapping GoogleMap in listview solved the problem for me. Please check it once.
That is indeed very interesting... When wrapping GoogleMap with the correct gestureRecognizers in a ListView with correct itemExtent, the issue seems to be solved. In my opinion however, this seems like a dirty workaround, which should be investigated further. However, thank you for the time being! :)
That is indeed very interesting... When wrapping GoogleMap with the correct gestureRecognizers in a ListView with correct itemExtent, the issue seems to be solved. In my opinion however, this seems like a dirty workaround, which should be investigated further. However, thank you for the time being! :)
Yes, it is bit hacky, flutter team needs to look on this.
Reproducible for both Virtual Display and Hybrid-Composition implementation: https://github.com/Sunbreak/hybrid_composition.trial
There is a popular feature on MIUI & EMUI probably related:
flutter doctor -v
[✓] Flutter (Channel unknown, 1.22.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-CN)
• Flutter version 1.22.4 at /Users/wangkun/flutter/flutter-1.22.x
• Framework revision 1aafb3a8b9 (5 weeks ago), 2020-11-13 09:59:28 -0800
• Engine revision 2c956a31c0
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/wangkun/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Users/wangkun/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
• Xcode at /Applications/Xcode11.7.app/Contents/Developer
• Xcode 11.7, Build version 11E801a
• CocoaPods version 1.10.0
[!] Android Studio (version 4.1)
• Android Studio at /Users/wangkun/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3)
• IntelliJ at /Users/wangkun/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
• Flutter plugin installed
• Dart plugin version 203.5981.152
[✓] VS Code (version 1.51.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.17.0
[✓] Connected device (3 available)
• MI 5 (mobile) • a871d739 • android-arm64 • Android 8.0.0 (API 26)
• iPhone SE (2nd generation) (mobile) • 4D0A13BA-3117-4745-8CAE-DB430E2FA1C9 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.7 19H2 darwin-x64
! Doctor found issues in 1 category.
Reproducible for both Virtual Display and Hybrid-Composition implementation: https://github.com/Sunbreak/hybrid_composition.trial
Comfirmed that https://github.com/flutter/flutter/pull/72611/files fixes the problem on hybrid_composition
I am also facing this issue. Any solution.
You can apply the patch in the mentioned PR to your local Flutter installation. Otherwise you have to wait for an official patch to be released. I am working on a new PR with an appropriate test such that it can get merged asap
As seen in the PR, the engine needs to get fixed. However, I don't have enough knowledge with that. So, any help is welcome from now on!
Reproducible for both Virtual Display and Hybrid-Composition implementation: https://github.com/Sunbreak/hybrid_composition.trial
Comfirmed that https://github.com/flutter/flutter/pull/72611/files fixes the problem on
hybrid_composition
This fixed my issues where the app freezes after detected 3 fingers gestures
@onebuck-code This isn't a fix. It's only a workaround as explained already. This issue has to get fixed in its core, which lies inside the engine.
For those who are facing this issue, Please follow
https://stackoverflow.com/questions/54280541/google-map-in-flutter-not-responding-to-touch-events
body: ListView( itemExtent: Get.size.height - Get.statusBarHeight, children: [ GoogleMap( onMapCreated: _onMapCreated, initialCameraPosition: CameraPosition( target: LatLng(51.608800, 0.122630), ), gestureRecognizers: Set() ..add(Factory<PanGestureRecognizer>(() => PanGestureRecognizer())) ..add(Factory<ScaleGestureRecognizer>( () => ScaleGestureRecognizer())) ..add(Factory<TapGestureRecognizer>(() => TapGestureRecognizer())) ..add(Factory<VerticalDragGestureRecognizer>( () => VerticalDragGestureRecognizer())), ), ], ),
itemExtent: ScreenHeight - statusBarHeight
it worked
Any updates?
I was able to reproduce this on latest master (on a Xiaomi device).
related issue b/189813582
@blasten, could you take a look?
This fix is https://github.com/flutter/flutter/pull/82013 although it's missing tests.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
Description
When using 3 or more fingers on the Google Map, then the app throws an exception. After this exception is thrown once, it also gets thrown when using any other gesture (one or two fingers). The problem then persists until the app is restarted.
Test Environment
I tested this on a Xiaomi Mi9T Pro with the Xiaomi.eu rom version 20.10.29 using my main app, a custom made app for this testing purpose and it even affects the example app itself. Edit 1: Also tested now on COL-L29 (Honor 10) with Android 9, EMUI 9.1.0 Edit 2: Also tested by @takinok on Galaxy S20 5G with Android 10 (see https://github.com/AndreHaueisen/flushbar/issues/161) Edit 3: Also tested by @rakeshlanjewar on Redmi Note 6 Pro (tulip)
Version used
According to my own
pubspec.lock
, I am usinggoogle_maps_flutter 1.0.6
(still exists in2.0.2
) andlocation 3.0.2
(still exists in4.1.1
). Edit 1: Also, this affects the example app, which only hasgoogle_maps_flutter
. Edit 2: It doesn't only affectgoogle_maps_flutter
, but also various other libraries and widgetsVideo
https://www.youtube.com/watch?v=38tWaMTFqEQ
Exception
Flutter 2 (current)
``` E/AccessibilityNodeInfo(26907): Rejecting attempt to make a View its own child E/flutter (26907): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Null check operator used on a null value E/flutter (26907): #0 _AndroidMotionEventConverter.toAndroidMotionEvent (package:flutter/src/services/platform_views.dart:597:31) E/flutter (26907): #1 AndroidViewController.dispatchPointerEvent (package:flutter/src/services/platform_views.dart:869:31) E/flutter (26907): #2 _PlatformViewGestureRecognizer.handleEvent (package:flutter/src/rendering/platform_view.dart:558:26) E/flutter (26907): #3 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:93:12) E/flutter (26907): #4 PointerRouter._dispatchEventToRoutes.Flutter 1
``` I/HiTouch_HiTouchSensor(13396): HiTouch Setting Switch, ON I/HiTouch_HiTouchSensor(13396): Checking pkgName: io.flutter.plugins.googlemapsexample Checking result: true I/HiTouch_HiTouchSensor(13396): HiTouch Setting Switch, ON W/HiTouch_PressGestureDetector(13396): HiTouch Miss: more than two pointers. W/HiTouch_PressGestureDetector(13396): HiTouch Miss: more than two pointers. W/HiTouch_PressGestureDetector(13396): Touch pointer move a lot. The moving distance of X is:27.974106, limit is:60The moving distance of Y is:61.97281, limit is:60 I/HiTouch_HiTouchSensor(13396): HiTouch Setting Switch, ON I/HiTouch_HiTouchSensor(13396): Checking pkgName: io.flutter.plugins.googlemapsexample Checking result: true W/HiTouch_PressGestureDetector(13396): HiTouch Miss: more than two pointers. E/flutter (13396): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Null check operator used on a null value E/flutter (13396): #0 _AndroidMotionEventConverter.toAndroidMotionEvent (package:flutter/src/services/platform_views.dart:596:31) E/flutter (13396): #1 AndroidViewController.dispatchPointerEvent (package:flutter/src/services/platform_views.dart:864:31) E/flutter (13396): #2 _PlatformViewGestureRecognizer.handleEvent (package:flutter/src/rendering/platform_view.dart:535:26) E/flutter (13396): #3 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:77:12) E/flutter (13396): #4 PointerRouter._dispatchEventToRoutes.Fix
A workaround can be found in the PRs #72611, #82013, and #78874 (especially notice the different approaches mentioned in https://github.com/flutter/flutter/pull/78874#issuecomment-811111562).
A real fix would need the engine to be modified. Right now, when a 3-fingers (or more) gestures is registered on the device, the engine registers the gesture as some pointer down events, one for every finger. After that a position update, then a cancel pointers, and another position update event follow. Since the
downTimeMillis
get reset and thepointerPositions
andpointerProperties
lists have inconsistent lengths, thetoAndroidMotionEvent
function fails when either unpacking thedownTimeMillis
or when mapping thepointerPositions
orpointerProperties
lists to their corresponding pointers (sincepointerPositions.length
>pointerProperties.length
).flutter doctor -v
It should be worth noting, that I am also affected by #11940 and have not applied any workaround or whatsoever (the flutter and dart plugins are installed of course in Android Studio)
flutter doctor -v
``` [✓] Flutter (Channel stable, 2.0.6, on Microsoft Windows [Version 10.0.19042.964], locale de-DE) • Flutter version 2.0.6 at G:\Programme\Flutter_SDK • Framework revision 1d9032c7e1 (10 days ago), 2021-04-29 17:37:58 -0700 • Engine revision 05e680e202 • Dart version 2.12.3 [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at G:\Programme\Android_SDK • Platform android-S, build-tools 30.0.3 • Java binary at: B:\Programme\Java\JDK_14_0_1_64\bin\java • Java version Java(TM) SE Runtime Environment (build 14.0.1+7) ✗ Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/windows#android-setup for more details. [✓] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe [!] Visual Studio - develop for Windows (Visual Studio Community 2017 15.9.21) • Visual Studio at B:\Programme\MicrosoftVS\2017\Community • Visual Studio Community 2017 version 15.9.28307.1064 • Windows 10 SDK version 10.0.17763.0 ✗ Visual Studio 2019 or later is required. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions). [✓] IntelliJ IDEA Ultimate Edition (version 2021.1) • IntelliJ at G:\Programme\JetBrains\Toolbox\apps\IDEA-U\ch-0\211.7142.45 • 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 [✓] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.964] • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.128 • Edge (web) • edge • web-javascript • Microsoft Edge 90.0.818.56 ! Doctor found issues in 3 categories. ```Old flutter doctor -v
``` [✓] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.19042.610], locale de-DE) • Flutter version 1.22.3 at G:\Programme\Flutter_SDK • Framework revision 8874f21e79 (4 days ago), 2020-10-29 14:14:35 -0700 • Engine revision a1440ca392 • Dart version 2.10.3 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at G:\Programme\Android_SDK • Platform android-30, build-tools 30.0.2 • Java binary at: G:\Programme\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6858069\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [!] Android Studio (version 4.1.0) • Android Studio at G:\Programme\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6858069 ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) [✓] Connected device (1 available) • Mi 9T Pro (mobile) • 4d243599 • android-arm64 • Android 10 (API 29) ! Doctor found issues in 1 category. ```