【问题标题】:Here SDK Crash any tip why?这里 SDK Crash 有什么提示为什么?
【发布时间】:2022-11-01 16:59:03
【问题描述】:

使用 Flutter 的 Here SDK 导航。我看到了这次崩溃,不知道为什么会发生,我没有使用场地。任何提示?

这是我在 crashlytics 中看到的

    libsyXstem_kernel.dylib
    __pthread_kill + 8
    libsystem_pthread.dylib
    pthread_kill + 268
    libsystem_c.dylib
    abort + 168
    libsystem_malloc.dylib
    _malloc_put + 550
    libsystem_malloc.dylib
    malloc_report + 64
    libsystem_malloc.dylib
    free + 300
    arrow_right 6
    heresdk
    here_sdk_sdk_venue_threading_VenueThreads_get_type_id
    libdispatch.dylib
    _dispatch_client_callout + 20
    libdispatch.dylib
   _dispatch_root_queue_drain + 680
    libdispatch.dylib
   _dispatch_worker_thread2 + 164
    libsystem_pthread.dylib
   _pthread_wqthread + 228
    libsystem_pthread.dylib

【问题讨论】:

  • 这种崩溃需要被象征化。它不一定与场地有关。请联系 HERE 团队以表示崩溃。

标签: here-api


【解决方案1】:

请尝试以下 hellomap 示例。

导入“包:颤振/material.dart”; 导入“包:here_sdk/core.dart”; 导入“包:here_sdk/core.engine.dart”; 导入“包:here_sdk/core.errors.dart”; 导入“包:here_sdk/mapview.dart”;

无效主()异步{ // 通常,您只需在应用程序的生命周期内初始化 HERE SDK 一次。 _initializeHERESDK();

运行应用程序(我的应用程序()); }

无效_initializeHERESDK()异步{ // 需要在访问 SDKOptions 之前调用以加载必要的库。 SdkContext.init(IsolateOrigin.main);

// Set your credentials for the HERE SDK. String accessKeyId = "YOUR_ACCESS_KEY_ID"; String accessKeySecret = "YOUR_ACCESS_KEY_SECRET"; SDKOptions sdkOptions = SDKOptions.withAccessKeySecret(accessKeyId, accessKeySecret);

尝试 { 等待 SDKNativeEngine.makeSharedInstance(sdkOptions); } 关于实例化异常 { throw Exception("初始化 HERE SDK 失败。"); } }

MyApp 类扩展 StatelessWidget { @覆盖 小部件构建(BuildContext 上下文){ 返回材料应用程序( title: 'HERE SDK for Flutter - 你好地图!', 主页:HereMap(onMapCreated:_onMapCreated), ); }

无效_onMapCreated(HereMapController hereMapController){ 这里MapController.mapScene.loadSceneForMapScheme(MapScheme.normalDay, (MapError?error) { 如果(错误!= null){ print('地图场景未加载。MapError: ${error.toString()}'); 返回; }

  const double distanceToEarthInMeters = 8000;
  MapMeasure mapMeasureZoom = MapMeasure(MapMeasureKind.distance, distanceToEarthInMeters);
  hereMapController.camera.lookAtPointWithMeasure(GeoCoordinates(52.530932, 13.384915), mapMeasureZoom);
});

} }

有关完整示例,请查看以下链接。

https://github.com/heremaps/here-sdk-examples/tree/master/examples/latest/navigate/flutter/hello_map_app

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-01
    • 1970-01-01
    • 2010-12-25
    相关资源
    最近更新 更多