Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No implementation found for method subscribeToEvents #657

Open
favazHF opened this issue Aug 19, 2024 · 7 comments
Open

No implementation found for method subscribeToEvents #657

favazHF opened this issue Aug 19, 2024 · 7 comments

Comments

@favazHF
Copy link

favazHF commented Aug 19, 2024

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?

@Wiwo99
Copy link

Wiwo99 commented Aug 30, 2024

i have same problem!

@PuntitOwO
Copy link

PuntitOwO commented Sep 10, 2024

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 🤔

@vitorDevop
Copy link

vitorDevop commented Sep 21, 2024

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.

@HighSoftWare96
Copy link

Same exception here (Android and library at 2.3.0-rc.1).. Anything on this? Which version is not affected?

@vitorDevop
Copy link

vitorDevop commented Sep 27, 2024

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:

  • 2.2.0
  • 2.2.1
  • 2.1.0
  • 2.0.0

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?

@vitorDevop
Copy link

The package version 1.1.0 worked, but I had to modify the MapboxMapController.kt file to resolve lifecycle errors,

@mhammerc
Copy link

Hello, same problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants