Search code examples
flutterhere-api

RoutingEngine.calculateCarRoute returns "RoutingError.timedOut"


I'm trying to caculate a Route between two locations but RoutingEngine.calculateCarRoute always immediately returns RoutingError.timedOut. There is literally no time for a time out. Here's my code. Is this an issue with my code or with the SDK? I'm using the Flutter SDK Version 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

    }

Update

When debugging the app crashes with the following message:

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.

So this seems to be an issue within the C-Code of the SDK, I think.

Update 2

Version 4.3.2.0 solves the issue.


Solution

  • A time-out event may also occur when the device's proxy settings change and prohibit an internet connection.

    I would recommend to add permission handling (Android only) to see if this will fix your debugging issue. Since Flutter does not take care, it must be done in the native Android project. You can use this helper class to request all permissions from the HERE SDK's internal manifest. An integration example can be seen here.

    Secondly, while the HERE SDK for Flutter is still Beta, there are already some more example apps available. You can try to execute one of the official example apps to see if this will fix your issue. Here's the link to the routing example.