Skobbler在Android中映射自定义路线计算

时间:2016-04-27 18:41:54

标签: android skmaps skobbler-maps

我们开始研究Skobbler地图,并使用我们在Skobbler帐户中生成的API密钥下载演示项目AndroidOpenSourceDemoGradle,并开始处理我们自己的纬度和经度值。 我们尝试使用方法launchRouteCalculation()计算自定义路线,方法是以SKCordinate的形式传递起始位置和结束位置。
在同一方法中,我们通过传递包含纬度和经度值的列表com.skobbler.ngx.routing.SKRouteManager.calculateRouteWithPoints()对象以及SKPostion对象来调用SKRouteSettings

我们尝试的代码

List pointsList = new ArrayList();
pointsList.add(new SKPosition(23.609239, 46.767936));
pointsList.add(new SKPosition(23.609149, 46.769281));
pointsList.add(new SKPosition(23.605704, 46.768879));
// set the route listener
SKRouteManager.getInstance().setRouteListener(this);
SKRouteSettings routeSettings = new SKRouteSettings();
//set route mode
routeSettings.setRouteMode(SKRouteMode.CAR_FASTEST);
        SKRouteManager.getInstance().calculateRouteWithPoints(pointsList,routeSettings);

但我们以错误陈述

结束
  

GPX轨道导航可用于企业许可的商业用途“和       应用程序中的JNI DETECTED ERROR:jmethodID为NULL。

我们在日志中遇到的确切错误声明如下

04-27 23:31:44.881 9577-9577/com.skobbler.sdkdemo E/SKRouteManager: GPX track navigation is available for commercial use with a enterprise license
 04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: jmethodID was NULL
04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]     in call to CallDoubleMethodV

04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]     from void com.skobbler.ngx.routing.SKRouteManager.createroutefromgpspoints(com.skobbler.ngx.positioner.SKPosition[], int, boolean, boolean, boolean, boolean)

04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65] "main" prio=5 tid=1 Runnable

04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x74ab0000 self=0xf4c27800

04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   | sysTid=9577 nice=0 cgrp=default sched=0/0 handle=0xf723bbec

04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   | state=R schedstat=( 1395219590 318169633 1433 ) utm=113 stm=26 core=0 HZ=100

04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   | stack=0xff563000-0xff565000 stackSize=8MB

04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held)

04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #00 pc 0000485c  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)

04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #01 pc 00003005  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)

04-27 23:31:44.950 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #02 pc 00243911  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)

04-27 23:31:44.951 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #03 pc 00227cb9  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+144)

04-27 23:31:44.951 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #04 pc 000aff1b  /system/lib/libart.so (art::JniAbort(char const*, char const*)+582)

04-27 23:31:44.951 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #05 pc 000b0661  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+60)

04-27 23:31:44.951 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #06 pc 000b090b  /system/lib/libart.so (art::ScopedCheck::CheckSig(_jmethodID*, char const*, bool) (.constprop.131)+358)

04-27 23:31:44.951 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #07 pc 000ba779  /system/lib/libart.so (art::CheckJNI::CallDoubleMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+60)

04-27 23:31:44.951 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #08 pc 000fa67b  /data/app/com.skobbler.sdkdemo-1/lib/arm/libngnative.so (_JNIEnv::CallDoubleMethod(_jobject*, _jmethodID*, ...)+22)

04-27 23:31:44.951 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #09 pc 000e9df1  /data/app/com.skobbler.sdkdemo-1/lib/arm/libngnative.so (Java_com_skobbler_ngx_routing_SKRouteManager_createroutefromgpspoints+144)

04-27 23:31:44.951 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   native: #10 pc 0019c8d3  /data/dalvik-cache/arm/data@app@com.skobbler.sdkdemo-1@base.apk@classes.dex (Java_com_skobbler_ngx_routing_SKRouteManager_createroutefromgpspoints___3Lcom_skobbler_ngx_positioner_SKPosition_2IZZZZ+142)

04-27 23:31:44.951 9577-9577/com.skobbler.sdkdemo A/art: art/runtime/check_jni.cc:65]   at com.skobbler.ngx.routing.SKRouteManager.createroutefromgpspoints(Native method) 04-27 23:31:44.951 9577-9577/com.skobbler.sdkdemo A/art:         art/runtime/check_jni.cc:65] atcom.skobbler.ngx.routing.SKRouteManager.calculateRouteWithPoints(SourceFile:327)

有人可以帮我们解决这个错误吗?

1 个答案:

答案 0 :(得分:1)

这是2.5.1 SDK的已知错误。提供了一个修补程序来解决此问题。可以从here

下载2.5.1的最新版本