我正在更新Skobbler到版本2.5.2以修复libpng Google Play警告(我也尝试更新到版本3+),但导航在更新后停止正常工作。
在 onRouteCalculationCompleted 之后,我使用了检查建议列表 SKRouteManager.getInstance()。getAdviceList()并接收有效的建议。
SKRouteAdvice [adviceID=0, timeToDestination=261, distanceToDestination=1234, timeToAdvice=0, distanceToAdvice=0, streetName=Rua Barao do Abiaí, visualAdviceFile=/data/user/0/myapp/files/SKMaps//Advisor/Visual/104962/1.png, advicePosition=[-35.886744260787964,-7.215477737837522], adviceInstruction=Now turn left then turn right , audioFilePlaylist=[now, turn_left, then_open, turn_right], currentStreetType=RESIDENTIAL, currentStreetFCClass=FC3, streetDirection=DIRECTION_LEFT]
然而,在导航时,建议是无效的,如下所示:
onUpdateNavigationState SKNavigationState [adviceID=-1, currentSpeed=5.304781188371101E-58, currentSpeedLimit=0.0, countryCode=, lastAdvice=false, showSignPost=false, currentAdviceCurrentStreetName=, currentAdviceNextStreetName=, currentAdviceCurrentOsmStreetType=UNDEFINED, currentAdviceNextOsmStreetType=UNDEFINED, currentAdviceDistanceToAdvice=-738480304, currentAdviceTimeToDestination=-738962832, currentAdviceDistanceToDestination=-738480656, currentAdviceVisualAdviceFile=, currentAdviceAudioAdvices=[None], currentAdviceExitNumber=, nextAdviceCurrentStreetName=, nextAdviceNextStreetName=, nextAdviceDistanceToAdvice=-738854288, nextAdviceVisualAdviceFile=, nextAdviceCurrentOsmStreetType=UNDEFINED, nextAdviceNextOsmStreetType=UNDEFINED, distanceToDestination=0.0, firstCrossingDescriptor=SKCrossingDescriptor [crossingType=0, routeAngle=0.0, turnToRight=false, directionUK=false, allowedRoutesAngles=null, forbiddenRoutesAngles=null], secondCrossingDescriptor=SKCrossingDescriptor [crossingType=0, routeAngle=0.0, turnToRight=false, directionUK=false, allowedRoutesAngles=null, forbiddenRoutesAngles=null], adviceInstruction=, viaPointsInfo=null, isLastVisualAdvice=false, currentStreetDirection=DIRECTION_INVALID, nextStreetDirection=DIRECTION_INVALID]
要检查建议列表是否仍然有效,我在开始导航之前添加了一个日志代码,并且应用程序崩溃并出现以下错误:
02-10 12:06:43.769 3236-3236/myapp A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 3236 (urance.myapp)
02-10 12:06:43.994 4166-4166/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-10 12:06:43.995 4166-4166/? A/DEBUG: Build fingerprint: 'google/bullhead/bullhead:7.1.1/N4F26O/3582057:user/release-keys'
02-10 12:06:43.995 4166-4166/? A/DEBUG: Revision: 'rev_1.0'
02-10 12:06:43.995 4166-4166/? A/DEBUG: ABI: 'arm'
02-10 12:06:43.995 4166-4166/? A/DEBUG: pid: 3236, tid: 3236, name: urance.myapp >>> myapp <<<
02-10 12:06:43.995 4166-4166/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
02-10 12:06:43.995 4166-4166/? A/DEBUG: r0 00000001 r1 d71b69dd r2 00000002 r3 f1304a40
02-10 12:06:43.995 4166-4166/? A/DEBUG: r4 f1323200 r5 eb614ef0 r6 00000000 r7 00000002
02-10 12:06:43.995 4166-4166/? A/DEBUG: r8 00000001 r9 ffcd6bb4 sl c39fcd80 fp c4b7b000
02-10 12:06:43.995 4166-4166/? A/DEBUG: ip 00000000 sp ffcd6a38 lr d72b8347 pc d72b834c cpsr 000f0030
02-10 12:06:43.998 4166-4166/? A/DEBUG: backtrace:
02-10 12:06:44.000 4166-4166/? A/DEBUG: #00 pc 0033734c /data/app/myapp-2/lib/arm/libngnative.so (_ZN17SkAdviceGenerator14fillAdviceInfoEiiR16NGAdviceTypeEnumR12SkAdviceInfo+671)
02-10 12:06:44.000 4166-4166/? A/DEBUG: #01 pc 003367ff /data/app/myapp-2/lib/arm/libngnative.so (_ZN17SkAdviceGenerator17generateNewAdviceEibbPK6CRoute+550)
02-10 12:06:44.000 4166-4166/? A/DEBUG: #02 pc 00332adb /data/app/myapp-2/lib/arm/libngnative.so (_ZN9SkAdvisor22generateAllAdvicesOnceERK6CRouteb+566)
02-10 12:06:44.000 4166-4166/? A/DEBUG: #03 pc 0011033f /data/app/myapp-2/lib/arm/libngnative.so (NG_GetAdviceList+142)
02-10 12:06:44.000 4166-4166/? A/DEBUG: #04 pc 000efcab /data/app/myapp-2/lib/arm/libngnative.so (Java_com_skobbler_ngx_routing_SKRouteManager_getadvicelist+38)
02-10 12:06:44.000 4166-4166/? A/DEBUG: #05 pc 006cb7d1 /data/app/myapp-2/oat/arm/base.odex (offset 0x658000)
P.S。:我的代码与Skobbler的演示项目非常相似。
其他人是否有同样的问题?
答案 0 :(得分:0)
设置 SKAdvisorSettings 时出现此问题。在更新Skobbler版本时,我忘了将我的自定义建议声音文件复制到正确的位置。
Skobbler无法找到某些特定语言(自定义文件)的建议和配置文件,导致导航无法正常工作。
我相信Skobbler SDK在这种情况下会引发一些异常或警告,因为错误与导航数据无关,例如距离和到目的地的时间。建议不应该因为无法找到建议声音文件而变得无效。
因此,如果您遇到同样的问题,请检查您的建议文件是否在正确的文件夹中。