Repository navigation
iOS: Platform View stops responding to GestureInput #37579
Copy link
Copy link
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appsf: gesturesflutter/packages/flutter/gestures repository.flutter/packages/flutter/gestures repository.found in release: 2.1Found to occur in 2.1Found to occur in 2.1frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Hello,
I use a MKMapView (Apple Maps) inside a PlatformView and it’s working fine.
But after using a SearchView (with showSearch) and dismissing it, the platformView is only responding to touch events for one more time.
After that, nothing happens if you try to move the map or zoom etc.
Every other flutter widget on screen is still working fine.
This affects both debug builds and release builds and it affects simulator (most of the time) and real devices (all the time).
I also uploaded a demo project on google drive, so you can reproduce the bug.
The bug occurs most of the time but if not, please close and restart the app and follow the steps again.
Video of bug:
Link
Demo project:
Link
Steps to Reproduce
- Move the map (then wait until touch is finished / animation finished)
- Press SearchButton
- Press dismiss button (in the top left corner)
- Move the Map (then wait until touch is finished / animation finished)
- Try to move the map again -> Map not moving/interactive anymore
If the map is still interactive, repeat steps 2 through 5
If the bug still not occurs, try closing and reopening the app and follow the steps again.
Logs
[+16700 ms] [DEVICE LOG] 2019-08-03 19:13:35.431071+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124b5b, Description: send gesture actions
[ +38 ms] [DEVICE LOG] 2019-08-03 19:13:35.468868+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124b5c, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:35.469011+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124b5d, Description: send gesture actions
[ +14 ms] [DEVICE LOG] 2019-08-03 19:13:35.485203+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124b5e, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:35.485516+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124b5f, Description: send gesture actions
[ +16 ms] [DEVICE LOG] 2019-08-03 19:13:35.501697+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e00, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:35.502253+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e01, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:35.502346+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e02, Description: send gesture actions
[ +199 ms] [DEVICE LOG] 2019-08-03 19:13:35.699206+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e03, Description: send gesture actions
[ +2 ms] [DEVICE LOG] 2019-08-03 19:13:35.699953+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e04, Description: send gesture actions
[ +181 ms] [DEVICE LOG] 2019-08-03 19:13:35.884511+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e05, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:35.885436+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e06, Description: send gesture actions
[ +193 ms] [DEVICE LOG] 2019-08-03 19:13:36.078856+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e07, Description: send gesture actions
[ +2 ms] [DEVICE LOG] 2019-08-03 19:13:36.079591+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e08, Description: send gesture actions
[ +178 ms] [DEVICE LOG] 2019-08-03 19:13:36.259984+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e09, Description: send gesture actions
[ +1 ms] [DEVICE LOG] 2019-08-03 19:13:36.260367+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e0a, Description: send gesture actions
[ +189 ms] [DEVICE LOG] 2019-08-03 19:13:36.450115+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e0b, Description: send gesture actions
[ +1 ms] [DEVICE LOG] 2019-08-03 19:13:36.451050+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e0c, Description: send gesture actions
[ +186 ms] [DEVICE LOG] 2019-08-03 19:13:36.639542+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e0d, Description: send gesture actions
[ +2 ms] [DEVICE LOG] 2019-08-03 19:13:36.640424+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e0e, Description: send gesture actions
[ +182 ms] [DEVICE LOG] 2019-08-03 19:13:36.822902+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e0f, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:36.823640+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e50, Description: send gesture actions
[ +183 ms] [DEVICE LOG] 2019-08-03 19:13:37.008348+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e51, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:37.009338+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e52, Description: send gesture actions
[ +184 ms] [DEVICE LOG] 2019-08-03 19:13:37.193897+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e53, Description: send gesture actions
[ +2 ms] [DEVICE LOG] 2019-08-03 19:13:37.194664+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e54, Description: send gesture actions
[ +185 ms] [DEVICE LOG] 2019-08-03 19:13:37.379020+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e55, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:37.379704+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e56, Description: send gesture actions
[ +181 ms] [DEVICE LOG] 2019-08-03 19:13:37.563925+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e57, Description: send gesture actions
[ +2 ms] [DEVICE LOG] 2019-08-03 19:13:37.564301+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e58, Description: send gesture actions
[ +357 ms] [DEVICE LOG] 2019-08-03 19:13:37.922696+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e59, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:37.922928+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e5a, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:37.923770+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e5b, Description: send gesture actions
[+2181 ms] [DEVICE LOG] 2019-08-03 19:13:40.107651+0200 localhost Runner[30814]: (AXRuntime) [com.apple.Accessibility:AXRuntimeCommon] This class 'FlutterSemanticsObject' is not a known serializable element and returning it as an
accessibility element may lead to crashes
[ +13 ms] [DEVICE LOG] 2019-08-03 19:13:40.120996+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e5c, Description: send gesture actions
[ +92 ms] [DEVICE LOG] 2019-08-03 19:13:40.210532+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124e5d, Description: send gesture actions
[ +14 ms] [DEVICE LOG] 2019-08-03 19:13:40.227109+0200 localhost Runner[30814]: (Flutter) flutter: Test
[ ] flutter: Test
[ +390 ms] [DEVICE LOG] 2019-08-03 19:13:40.618156+0200 localhost Runner[30814]: (CallKit) [com.apple.calls.callkit:Default] Call host has no calls
[ +9 ms] [DEVICE LOG] 2019-08-03 19:13:40.627397+0200 localhost Runner[30814]: (CoreFoundation) Created Activity ID: 0x124e5e, Description: Updating Key-Value Observers Of Preferences
[ +4 ms] [DEVICE LOG] 2019-08-03 19:13:40.630439+0200 localhost Runner[30814]: (UIKitCore) [com.apple.UIKit:FeedbackActivation] activate generator with style: TurnOn; activationCount: 0 -> 1; styleActivationCount: 0 -> 1;
<_UIKeyboardFeedbackGenerator: 0x600007e00000>
[ +1 ms] [DEVICE LOG] 2019-08-03 19:13:40.630645+0200 localhost Runner[30814]: (UIKitCore) [com.apple.UIKit:Feedback] activate engine <_UIFeedbackSystemSoundEngine: 0x60000239a140>, clientCount: 0 -> 1
[ +1 ms] [DEVICE LOG] 2019-08-03 19:13:40.630729+0200 localhost Runner[30814]: (UIKitCore) [com.apple.UIKit:Feedback] activating engine <_UIFeedbackSystemSoundEngine: 0x60000239a140>
[ ] [DEVICE LOG] 2019-08-03 19:13:40.631095+0200 localhost Runner[30814]: (UIKitCore) [com.apple.UIKit:Feedback] engine <_UIFeedbackSystemSoundEngine: 0x60000239a140: state=3, numberOfClients=1, prewarmCount=0,
_internal_isSuspended=0> state changed: Inactive -> Activating
[ +1 ms] [DEVICE LOG] 2019-08-03 19:13:40.631289+0200 localhost Runner[30814]: (UIKitCore) [com.apple.UIKit:Feedback] engine <_UIFeedbackSystemSoundEngine: 0x60000239a140: state=4, numberOfClients=1, prewarmCount=0,
_internal_isSuspended=0> state changed: Activating -> Running
[ ] [DEVICE LOG] 2019-08-03 19:13:40.635018+0200 localhost Runner[30814]: (RunningBoardServices) Created Activity ID: 0x124e5f, Description: didChangeInheritances
[+1595 ms] [DEVICE LOG] 2019-08-03 19:13:42.233585+0200 localhost Runner[30814]: (AXRuntime) [com.apple.Accessibility:AXRuntimeCommon] This class 'FlutterSemanticsObject' is not a known serializable element and returning it as an
accessibility element may lead to crashes
[ +19 ms] [DEVICE LOG] 2019-08-03 19:13:42.252617+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124ef0, Description: send gesture actions
[ +62 ms] [DEVICE LOG] 2019-08-03 19:13:42.315455+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124ef1, Description: send gesture actions
[ +25 ms] [DEVICE LOG] 2019-08-03 19:13:42.336119+0200 localhost Runner[30814]: (UIKitCore) [com.apple.UIKit:FeedbackActivation] deactivate generator with style: TurnOn; activationCount: 1 -> 0; styleActivationCount: 1 -> 0;
<_UIKeyboardFeedbackGenerator: 0x600007e00000>
[ ] [DEVICE LOG] 2019-08-03 19:13:42.336203+0200 localhost Runner[30814]: (UIKitCore) [com.apple.UIKit:Feedback] deactivate engine <_UIFeedbackSystemSoundEngine: 0x60000239a140>, clientCount: 1 -> 0
[ ] [DEVICE LOG] 2019-08-03 19:13:42.336260+0200 localhost Runner[30814]: (UIKitCore) [com.apple.UIKit:Feedback] _internal_deactivateEngineIfPossible <_UIFeedbackSystemSoundEngine: 0x60000239a140>, clientCount: 0, suspended: 0
[ ] [DEVICE LOG] 2019-08-03 19:13:42.336313+0200 localhost Runner[30814]: (UIKitCore) [com.apple.UIKit:Feedback] _internal_deactivateEngineIfPossible <_UIFeedbackSystemSoundEngine: 0x60000239a140> tearedDown: 1
[ ] [DEVICE LOG] 2019-08-03 19:13:42.336436+0200 localhost Runner[30814]: (UIKitCore) [com.apple.UIKit:Feedback] engine <_UIFeedbackSystemSoundEngine: 0x60000239a140: state=0, numberOfClients=0, prewarmCount=0,
_internal_isSuspended=0> state changed: Running -> Inactive
[+4715 ms] [DEVICE LOG] 2019-08-03 19:13:47.059008+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124ef2, Description: send gesture actions
[ +16 ms] [DEVICE LOG] 2019-08-03 19:13:47.075408+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124ef3, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:47.075785+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124ef4, Description: send gesture actions
[ +197 ms] [DEVICE LOG] 2019-08-03 19:13:47.269943+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124ef5, Description: send gesture actions
[ +190 ms] [DEVICE LOG] 2019-08-03 19:13:47.458765+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124ef6, Description: send gesture actions
[ +176 ms] [DEVICE LOG] 2019-08-03 19:13:47.638649+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124ef7, Description: send gesture actions
[ +186 ms] [DEVICE LOG] 2019-08-03 19:13:47.825529+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124ef8, Description: send gesture actions
[ +347 ms] [DEVICE LOG] 2019-08-03 19:13:48.171989+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124ef9, Description: send gesture actions
[ ] [DEVICE LOG] 2019-08-03 19:13:48.172199+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124efa, Description: send gesture actions
[+2893 ms] [DEVICE LOG] 2019-08-03 19:13:51.067636+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124efb, Description: send gesture actions
[ +736 ms] [DEVICE LOG] 2019-08-03 19:13:51.804476+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124efc, Description: send gesture actions
[ +722 ms] [DEVICE LOG] 2019-08-03 19:13:52.526711+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124efd, Description: send gesture actions
[ +496 ms] [DEVICE LOG] 2019-08-03 19:13:53.022698+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124efe, Description: send gesture actions
[ +460 ms] [DEVICE LOG] 2019-08-03 19:13:53.483232+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x124eff, Description: send gesture actions
[+1404 ms] [DEVICE LOG] 2019-08-03 19:13:54.887590+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x125110, Description: send gesture actions
[ +367 ms] [DEVICE LOG] 2019-08-03 19:13:55.255056+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x125111, Description: send gesture actions
[ +337 ms] [DEVICE LOG] 2019-08-03 19:13:55.592560+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x125112, Description: send gesture actions
[ +229 ms] [DEVICE LOG] 2019-08-03 19:13:55.821816+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x125113, Description: send gesture actions
[ +265 ms] [DEVICE LOG] 2019-08-03 19:13:56.087905+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x125114, Description: send gesture actions
[ +214 ms] [DEVICE LOG] 2019-08-03 19:13:56.302801+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x125115, Description: send gesture actions
[ +231 ms] [DEVICE LOG] 2019-08-03 19:13:56.534156+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x125116, Description: send gesture actions
[ +244 ms] [DEVICE LOG] 2019-08-03 19:13:56.778616+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x125117, Description: send gesture actions
[ +247 ms] [DEVICE LOG] 2019-08-03 19:13:57.025819+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x125118, Description: send gesture actions
[ +201 ms] [DEVICE LOG] 2019-08-03 19:13:57.226882+0200 localhost Runner[30814]: (UIKitCore) Created Activity ID: 0x125119, Description: send gesture actions
Maximilians-iMac:testproject maximilian$ flutter analyze
Analyzing testproject...
No issues found! (ran in 2.7s)
[✓] Flutter (Channel dev, v1.8.3, on Mac OS X 10.14.5 18F132, locale de-DE)
• Flutter version 1.8.3 at /Users/maximilian/Documents/Flutter/flutter-sdk
• Framework revision e4ebcdf6f4 (7 days ago), 2019-07-27 11:48:24 -0700
• Engine revision 38ac5f30a7
• Dart version 2.5.0 (build 2.5.0-dev.1.0 0ca1582afd)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
• Android SDK at /Users/maximilian/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode-beta.app/Contents/Developer
• Xcode 11.0, Build version 11M382q
• CocoaPods version 1.6.1
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 38.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] VS Code (version 1.36.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.3.0
[✓] Connected device (1 available)
• iPhone Xʀ • D41B7C5A-A833-4394-BAF7-9AD58713D067 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-0 (simulator)
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appsf: gesturesflutter/packages/flutter/gestures repository.flutter/packages/flutter/gestures repository.found in release: 2.1Found to occur in 2.1Found to occur in 2.1frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Activity
andaas4 commentedon Feb 11, 2020
I'm having the same problem with a stack that contains a PlatformView with MKMapView and a MaterialButton, after pressing the MaterialButton twice the MKMapView stops responding. Before pressing the MaterialButton everything works as expected.
Stalder commentedon Feb 25, 2020
Same issue on Flutter v1.12.13+hotfix.8.
Also we had explored, that it can be not just MaterialButton or any other interactive widget. Touch to any Flutter view that is over the map leads to that behaviour. It works even with Text widget.
However, associated PlatformChannel still handle calls. So, i believe, that issue is related to gesture responding system.
Strange thing about this is that library has another behaviour. It doesn't stop responding at all, but after pressing the button over the map, it always skips next gesture on map, but continue responding on next gesture.
Links provided by author seems to be broken, so i'll provide repo to reproduce issue later
maxifuchs commentedon Feb 25, 2020
I fixed the links
darshankawar commentedon Feb 2, 2021
@maxiundtesa
I downloaded your demo link and compiled on latest master, but getting bunch of Xcode errors as below:
Xcode log
Hence I am unable to verify this issue on latest versions. Can you check and fix the demo link and provide a github repo instead that we can clone and run directly to verify this issue ?
pedromassangocode commentedon Feb 26, 2021
Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.
Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of
flutter doctor -v.All system setups can be slightly different, so it's always better to open new issues and reference related issues.
6 remaining items
cyanglaz commentedon Aug 26, 2021
@maxiundtesa
Looks like it might be a similar problem with #33988. Have you tried to use the new
WaitUntilTouchesEndedPolicy? See an example: flutter-team-archive/plugins#2746darshankawar commentedon Aug 27, 2021
@maxiundtesa
Please check above comment and solution and see if helps to resolve the issue.
maxifuchs commentedon Aug 27, 2021
@cyanglaz Unfortunately the new gesture recognizers policy changed nothing, the issue still persists
cyanglaz commentedon Aug 27, 2021
@maxiundtesa I suspect it is related to how the MKMapView is implemented. There might be some gestures or implementation details in touch event handling delegate methods (e.g. touchesBegan) conflicts with flutter's gesture handling mechanism.
maxifuchs commentedon Aug 27, 2021
@cyanglaz
Yeah, looks a bit like that, since that issue is apparently only prevalent with MKMapView…
So it‘s not the highest priority bug, but still would be nice to have it working for the native feel on iOS in the long term
lozdan commentedon Feb 8, 2024
Adding
gestureRecognizersBlockingPolicy: FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEndedto FlutterPluginRegistrar register fixed the issue for meKoheiKanagu commentedon Feb 8, 2024
@lozdan Wow! Thank you!
I was able to fix my issue that way too.
GHkmmm commentedon Sep 4, 2025
Is there any potential impact on the project if this parameter is added?