mapbox / mapbox/mapbox-maps-flutter
I encountered an error when using mapbox_maps_flutter.
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
When I am conducting real-device debugging with Flutter on a mobile phone running the HarmonyOS 4.2.0 system, the native channel always fails to be established, resulting in the failure of Mapbox.
[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.mapbox_maps_flutter._MapboxOptions.setAccessToken"., null, null)
E/flutter ( 6367): [#0](https://support.mapbox.com/hc/requests/0) _MapboxOptions.setAccessToken (package:mapbox_maps_flutter/src/pigeons/map_interfaces.dart:6246:7)
E/flutter ( 6367):
E/flutter ( 6367):
E/flutter ( 6367): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: plugins.flutter.io/mapbox_maps
E/flutter ( 6367): at io.flutter.plugin.platform.PlatformViewsController.createPlatformView(PlatformViewsController.java:508)
E/flutter ( 6367): at io.flutter.plugin.platform.PlatformViewsController$1.createForTextureLayer(PlatformViewsController.java:196)
E/flutter ( 6367): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:128)
E/flutter ( 6367): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:55)
E/flutter ( 6367): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/flutter ( 6367): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/flutter ( 6367): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/flutter ( 6367): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
E/flutter ( 6367): at android.os.Handler.handleCallback(Handler.java:966)
E/flutter ( 6367): at android.os.Handler.dispatchMessage(Handler.java:110)
E/flutter ( 6367): at android.os.Looper.loopOnce(Looper.java:205)
E/flutter ( 6367): at android.os.Looper.loop(Looper.java:293)
E/flutter ( 6367): at android.app.ActivityThread.loopProcess(ActivityThread.java:9998)
E/flutter ( 6367): at android.app.ActivityThread.main(ActivityThread.java:9987)
E/flutter ( 6367): at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 6367): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:586)
E/flutter ( 6367): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1240)
E/flutter ( 6367): , null, null)
E/flutter ( 6367): [#0](https://support.mapbox.com/hc/requests/0) StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7)
E/flutter ( 6367): [#1](https://support.mapbox.com/hc/requests/1) MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:370:18)
E/flutter ( 6367):
E/flutter ( 6367): [#2](https://support.mapbox.com/hc/requests/2) TextureAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1149:9)
E/flutter ( 6367):
E/flutter ( 6367): [#3](https://support.mapbox.com/hc/requests/3) AndroidViewController.create (package:flutter/src/services/platform_views.dart:809:5)
E/flutter ( 6367):
E/flutter ( 6367): [#4](https://support.mapbox.com/hc/requests/4) AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:836:7)
E/flutter ( 6367):
E/flutter ( 6367): [#5](https://support.mapbox.com/hc/requests/5) RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:178:29)
E/flutter ( 6367):
E/flutter ( 6367):
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure on a real device running HarmonyOS 4.2.0, starting with package:mapbox_maps_flutter/src/pigeons/map_interfaces.dart at line 6246 and Flutter's platform-channel and platform-view errors. Trace whether native channel and platform-view registration fail; done means the map initializes without either reported PlatformException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100