RoutingEngine.calculateCarRoute返回 "RoutingError.timedOut"

问题描述 投票:0回答:1

我想在两个地点之间建立一条路线,但是... ... RoutingEngine.calculateCarRoute 总是立即返回 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版本解决了这个问题。

flutter here-api
1个回答
2
投票

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

我建议添加权限处理(仅限安卓系统),看看是否能解决你的调试问题。由于Flutter没有照顾到,所以必须在原生Android项目中进行。你可以使用这个 辅导班 来请求HERE SDK的内部清单中的所有权限。可以看到一个集成的例子 此处.

其次,虽然HERE SDK for Flutter还是Beta版,但已经有一些更多的示例应用可用。你可以尝试执行一个官方的示例应用程序,看看这是否会解决你的问题。这里是链接到 路由示例.

© www.soinside.com 2019 - 2024. All rights reserved.