Open favazHF opened 2 months ago
i have same problem!
I was able to find an invocation in map_events.dart:L58 And it is supposed to handle it in EventHandler.kt:L60 So, for some reason that condition is false 🤔
The issue occurs with the latest version of the package (mapbox_maps_flutter: ^2.2.1
).
Attempted Workarounds:
The error is thrown inside the Flutter code of the package, not the Android native code. I initially tried commenting out the result.notImplemented()
line in the EventHandler class of the Android source code, but this did not resolve the issue. Here is the relevant code snippet:
EventHandler.kt Line 72.
I then tried temporarily resolving the issue by commenting out the line that throws a MissingPluginException()
in the Flutter source code, but this did not work either. Here is the relevant code snippet:
map_events.dart Line 72.
I also added a try-catch block around this line, but it didn't work:
map_events.dart Line 57.
Suspected Cause:
I suspect the issue might be related to lifecycle handling when resuming the app, possibly inside the following file:
MapboxMapController.kt.
However, the same issue also occurs on iOS, suggesting it might not be limited to Android's lifecycle management.
Would appreciate any guidance on a more permanent fix or if there’s an update planned to address this.
Same exception here (Android and library at 2.3.0-rc.1).. Anything on this? Which version is not affected?
I've tested the issue with the latest Flutter versions (3.24.0
and 3.24.3
), and the problem persists. Below are the versions of the mapbox_maps_flutter
package I tested:
It's worth noting that version 0.5.1
of the package worked correctly without this issue when using Flutter 3.7.11
. This suggests that the problem may be related to changes introduced in newer versions of the package or Flutter SDK.
Could you please look into this, or provide any guidance on potential workarounds?
The package version 1.1.0
worked, but I had to modify the MapboxMapController.kt
file to resolve lifecycle errors,
Hello, same problem here.
We are also experiencing this issue in our sentry logs from multiple devices, multiple OS
Hi all, thank you for reporting this and sorry for the inconvenience, has anybody been able to reproduce it? A piece of sample code would be much appreciated 🙏
I looked into this and so far my theory is that platform view might take a while get up and running, and during this time the channels are not hooked up, so if we will try to send event subscription update request then - we get an exception that nobody has answered the call.
I made a draft PR for this https://github.com/mapbox/mapbox-maps-flutter/pull/724 if somebody wants to try it out.
I have made some tests and the porblem looks that it is resolved.
@evil159 Do you think this solution will be released soon? the metrics of the error handlers are affected by this crash.
@favazHF @ciakov Thank you for confirming the fix. It is scheduled for release in version 2.4.0, with the beta expected to be available later this week.
We have tried this fix in production with real users and the issue is gone. Thank you @evil159!
Error:
Crash MethodChannel._invokeMethod package:flutter/src/services/platform_channel.dart:332 MissingPluginException(No implementation found for method subscribeToEvents on channel com.mapbox.maps.flutter.map_events)
Devices: Android and iOS
Mapbox version:
mapbox_maps_flutter: ^2.1.0
I have been getting these reports to our error tracker, what can it be or how can it be solved?