RoutingEngine.calculateCarRoute returns "RoutingError.timedOut"

RoutingEngine.calculateCarRoute returns "RoutingError.timedOut"

我正在尝试计算两个位置之间的路线,但 RoutingEngine.calculateCarRoute 总是立即 returns RoutingError.timedOut。实际上没有时间暂停。这是我的代码。这是我的代码问题还是 SDK 问题?我正在使用 Flutter SDK 版本 4.3.1.0。

await RoutingEngine().calculateCarRoute(
    [
      Waypoint(
          GeoCoordinates(
            departure.latitude,
            departure.longitude,
          ),
          WaypointType.stopover,
          500,
          360,
          90),
      Waypoint(
          GeoCoordinates(
            destination.latitude,
            destination.longitude,
          ),
          WaypointType.stopover,
          500,
          360,
          90)
    ],
    CarOptions(
        RouteOptions(
            OptimizationMode.fastest, 3, routeInformation.departureTime),
        RouteTextOptions(
            LanguageCode.deDe, TextFormat.plain, UnitSystem.metric),
        AvoidanceOptions([], [CountryCode.deu])),
    (RoutingError routingError, List<Route> routeList) async {

      // process result or receive error with callback

    }

更新

调试应用时崩溃并显示以下消息:

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7e9e500000
Abort message: '[FATAL] Storage.LevelDB - Cannot open database IO error: /12/LOCK @ ../../../../../external/leveldb/util/env_posix.cc:445 virtual leveldb::Status leveldb::(anonymous namespace)::PosixEnv::LockFile(const std::string &, leveldb::FileLock **): No such file or directory'
    x0  0000007ead01adc8  x1  0000007ea03bdd58  x2  0000000000000001  x3  0000000000000019
    x4  0000000000000188  x5  0000007e86be9732  x6  0000007f4ea2f000  x7  0000000003410486
    x8  0000000000000000  x9  0000000000000000  x10 0000007e9e480050  x11 000000000007ffb0
    x12 0000000000000000  x13 000000000007ffb1  x14 00399f1ee3a0f76d  x15 000052f562d4cd6a
    x16 0000007ea21ae398  x17 0000007f49c697b4  x18 0000000000000010  x19 0000007ea03bdd48
    x20 0000007ea03bdd58  x21 0000000000000001  x22 0000007ea21b9b74  x23 000000000007ffad
    x24 0000007ead01aae8  x25 0000007ead01ab18  x26 0000007e993f0e08  x27 0000000000000003
    x28 0000007ea27d44cc  x29 0000007ea2166558
    sp  0000007ea03bdd10  lr  0000007ea1d2b14c  pc  0000007ea1db321c
backtrace:
    #00 pc 00000000016e121c  /data/app/app-identifier-lo-9QLT1643OFdsEJYYtQg==/lib/arm64/libflutter.so (offset 0x1280000)
    #01 pc 0000000001659148  /data/app/app-identifier-lo-9QLT1643OFdsEJYYtQg==/lib/arm64/libflutter.so (offset 0x1280000)
    #02 pc 00000000016e75d4  /data/app/app-identifier-lo-9QLT1643OFdsEJYYtQg==/lib/arm64/libflutter.so (offset 0x1280000)
    #03 pc 0000000001774f88  /data/app/app-identifier-lo-9QLT1643OFdsEJYYtQg==/lib/arm64/libflutter.so (offset 0x1280000)
    #04 pc 0000000001657148  /data/app/app-identifier-lo-9QLT1643OFdsEJYYtQg==/lib/arm64/libflutter.so (offset 0x1280000)
    #05 pc 00000000016623a8  /data/app/app-identifier-lo-9QLT1643OFdsEJYYtQg==/lib/arm64/libflutter.so (offset 0x1280000)
    #06 pc 000000000175367c  /data/app/app-identifier-lo-9QLT1643OFdsEJYYtQg==/lib/arm64/libflutter.so (offset 0x1280000)
    #07 pc 0000000000001850  <anonymous:0000007e9e400000>
Lost connection to device.

所以我认为这似乎是 SDK 的 C 代码中的一个问题。

更新 2

版本 4.3.2.0 解决了这个问题。

当设备的代理设置更改并禁止互联网连接时,也可能会发生超时事件。

我建议添加权限处理(仅 Android)以查看这是否会解决您的调试问题。由于Flutter不会管,所以必须在原生Android项目中完成。你可以使用这个 helper class to request all permissions from the HERE SDK's internal manifest. An integration example can be seen here.

其次,虽然适用于 Flutter 的 HERE SDK 仍处于 Beta 阶段,但已经有更多示例应用可用。您可以尝试执行官方示例应用程序之一,看看这是否能解决您的问题。这是 link 到 routing example