mapbox / mapbox/mapbox-maps-flutter

App Crashes when we use flyTo. It sporadic but consistently crashes after using a few times

オープン
#982 コメント 0 件 リアクション 5 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Dart
スター
380
フォーク
204
PR マージ指標
30日以内にマージされた PR はありません

説明

Users search locations and using the lat and long and we drop the pin for the location. This is the piece of code that does this. the flyTo crashes sometimes but if we just use setCamera it works. Is this a know issue? Have attached the stacktrace below as well.

Future<void> _goToCurrentLocation(Position userPosition) async {
  try {
    final cameraOptions = CameraOptions(center: Point(coordinates: userPosition), zoom: 14.0,);
    final animationOptions = MapAnimationOptions(duration: 2000, startDelay: 0,);
    //fly to or ease to crashes. So we are using set camera
    await _mapboxMap.flyTo(cameraOptions, animationOptions);
    //await _mapboxMap.setCamera(cameraOptions);

    if (_currentLocMarker != null) {
      await _pointAnnotationManager.delete(_currentLocMarker!);
    }
    // Add a marker at current location
    final annotationOptions = PointAnnotationOptions(
      geometry: Point(coordinates: userPosition),
      iconImage: personalMarkerPin,
      iconSize: 1.0,);
    _currentLocMarker = await _pointAnnotationManager.create(annotationOptions);
    if (!mounted) {
      return;
    }
    await context.read<MapCubit>().getCompleteCurrentLocationMetaInfo(
        latitude: double.parse(userPosition.lat.toString()),
        longitude: double.parse(userPosition.lng.toString()));
  }catch(err){
    if (kDebugMode) {
      print('----errror $err');
    }
  }

}

[mapbox-maps-flutter] [Error, maps-core]: {}[Render]: FillBucket: adding non-polygon geometry (LineString) to the fill-layer
[sentry.flutterError] [error] Exception caught by widgets library
                      'package:flutter/src/widgets/navigator.dart': Failed assertion: line 4064 pos 12: '!_debugLocked': is not true.
                      #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:67:4)
                      #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:49:5)
                      #2      NavigatorState.dispose (package:flutter/src/widgets/navigator.dart:4064:12)
                      #3      StatefulElement.unmount (package:flutter/src/widgets/framework.dart:5922:11)
                      #4      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2075:13)
                      #5      ListIterable.forEach (dart:_internal/iterable.dart:49:13)
                      #6      _InactiveElements._unmountAll (package:flutter/src/widgets/framework.dart:2084:25)
                      #7      BuildOwner.lockState (package:flutter/src/widgets/framework.dart:2965:15)
                      #8      BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:3288:7)
                      #9      WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1247:19)
                      #10     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:495:5)
                      #11     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1438:15)
                      #12     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1351:9)
                      #13     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1204:5)
                      #14     _rootRun (dart:async/zone.dart:1525:13)
                      #15     _CustomZone.run (dart:async/zone.dart:1422:19)
                      #16     _CustomZone.runGuarded (dart:async/zone.dart:1321:7)
                      #17     _invoke (dart:ui/hooks.dart:333:10)
                      #18     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:444:5)
                      #19     _drawFrame (dart:ui/hooks.dart:303:31)
flutter: ----errror PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.mapbox_maps_flutter._AnimationManager.flyTo.0"., null, null)
[mapbox-maps-flutter] [Info, events_service]: Queue is empty, nothing to flush
[mapbox-maps-flutter] [Info, events_service]: Queue is empty, nothing to flush

======== Exception caught by widgets library =======================================================
The following assertion was thrown while finalizing the widget tree:
'package:flutter/src/widgets/navigator.dart': Failed assertion: line 4064 pos 12: '!_debugLocked': is not true.


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=02_bug.yml

When the exception was thrown, this was the stack: 
#2      NavigatorState.dispose (package:flutter/src/widgets/navigator.dart:4064:12)
#3      StatefulElement.unmount (package:flutter/src/widgets/framework.dart:5922:11)
#4      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2075:13)
#5      ListIterable.forEach (dart:_internal/iterable.dart:49:13)
#6      _InactiveElements._unmountAll (package:flutter/src/widgets/framework.dart:2084:25)
#7      BuildOwner.lockState (package:flutter/src/widgets/framework.dart:2965:15)
#8      BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:3288:7)
#9      WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1247:19)
#10     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:495:5)
#11     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1438:15)
#12     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1351:9)
#13     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1204:5)
#17     _invoke (dart:ui/hooks.dart:333:10)
#18     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:444:5)
#19     _drawFrame (dart:ui/hooks.dart:303:31)
(elided 5 frames from class _AssertionError and dart:async)
====================================================================================================

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

_goToCurrentLocation から開始し、提供された座標を使って flyTo の繰り返し呼び出しを再現し、flyTo パスと setCamera パスを比較します。報告された AnimationManager チャネルエラーと NavigatorState の破棄アサーションを使って失敗箇所を切り分けます。完了条件は、flyTo の繰り返し呼び出しによって報告されたクラッシュが発生しなくなることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
dart, flutter
領域
mobile-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。