简体   繁体   中英

why does SKMap crash when loading map?

I'm trying to integrate the Skobbler maps SDK in my android app. But the app crashes when I try to start the map.

Logs seem ok until there is a SIGSEGV signal with code SEGV_MAPERR

06-10 11:51:35.073: D/SKMaps(13187): SKPrepareMapTextureThread----PrepareMapTexture - COPY TIME 671
06-10 11:51:35.073: D/dalvikvm(13187): Trying to load lib /data/data/com.kolobee.mini/lib/libngnative.so 0x41550098
06-10 11:51:37.053: D/dalvikvm(13187): Added shared lib /data/data/com.kolobee.mini/lib/libngnative.so 0x41550098
06-10 11:51:41.173: D/dalvikvm(13187): GC_CONCURRENT freed 477K, 14% free 9126K/10503K, paused 11ms+2ms, total 105ms
06-10 11:52:02.403: D/SKMaps(13187): SKMapInitSettings---- Map style  [/storage/sdcard0/Android/data/com.kolobee.mini/files/SKMapsdaystyle/ , daystyle.json ,-1]
06-10 11:52:02.423: D/SKMaps(13187): SKmaps---- INITIALIZE SK MAPS WITH SETTINGS 
06-10 11:52:02.423: D/SKMaps(13187): SKmaps----versionFileName = version2_public_sdk_android_2_0.txt
06-10 11:52:02.433: D/SKMaps(13187): SKUtils----Return calculated device type 3
06-10 11:52:02.433: D/SKMaps(13187): SKmaps----ADVISOR com.skobbler.ngx.navigation.SKAdvisorSettings@416afb18
06-10 11:52:02.433: D/SKMaps(13187): SKmaps----Json file /storage/sdcard0/Android/data/com.kolobee.mini/files/SKMapsdaystyle/daystyle.json
06-10 11:52:02.438: D/SKMaps(13187): SKUtils----Return calculated device type 3
06-10 11:52:03.023: D/SKMaps(13187): SKUtils----found proxyUser: null, proxyPassword: null
06-10 11:52:03.333: D/SKMaps(13187): SKmaps----UID = f12e81d2a2796751fc8815a8e9f68c3d;1f515444368a6b691faab49851f156b4;788a1352a316fcc3bdbc15ed98fc182;ab19fa567447209d9ea477c33ee85bfb
06-10 11:52:03.333: D/SKMaps(13187): SKmaps----key = osName , value = android
06-10 11:52:03.333: D/SKMaps(13187): SKmaps----key = osVer , value = 4.1.2
06-10 11:52:03.333: D/SKMaps(13187): SKmaps----key = appName , value = 
06-10 11:52:03.333: D/SKMaps(13187): SKmaps----key = appVer , value = 
06-10 11:52:03.333: D/SKMaps(13187): SKmaps----key = uid , value = f12e81d2a2796751fc8815a8e9f68c3d;1f515444368a6b691faab49851f156b4;788a1352a316fcc3bdbc15ed98fc182;ab19fa567447209d9ea477c33ee85bfb
06-10 11:52:03.333: D/dalvikvm(13187): Trying to load lib /data/data/com.kolobee.mini/lib/libngnative.so 0x41550098
06-10 11:52:03.333: D/dalvikvm(13187): Shared lib '/data/data/com.kolobee.mini/lib/libngnative.so' already loaded in same CL 0x41550098
06-10 11:52:03.333: D/SKMaps(13187): SKmaps----INITIALIZE FCD  accountKey= locale= es macAddress=44:A7:CF:BC:D7:DC osName=android osVersion=4.1.2 deviceMaker =samsung deviceModel=GT-I9100 orientation= 1  appid=f12e81d2a2796751fc8815a8e9f68c3d;1f515444368a6b691faab49851f156b4;788a1352a316fcc3bdbc15ed98fc182;ab19fa567447209d9ea477c33ee85bfb appName= appVersion= serverUrl=http://tor.skobbler.net/tor
06-10 11:52:03.338: D/SKMaps(13187): SKmaps----ENABLE FCD true
06-10 11:52:03.433: D/SKMaps(13187): SKMapSurfaceView----SKMapSurfaceView constructor
06-10 11:52:03.433: D/SKMaps(13187): SKMapSurfaceView----os model GT-I9100
06-10 11:52:03.433: D/dalvikvm(13187): Trying to load lib /data/data/com.kolobee.mini/lib/libngnative.so 0x41550098
06-10 11:52:03.433: D/dalvikvm(13187): Shared lib '/data/data/com.kolobee.mini/lib/libngnative.so' already loaded in same CL 0x41550098
06-10 11:52:03.438: D/SKMaps(13187): MapRenderer----Set map density 1.5
06-10 11:52:03.463: D/TextLayoutCache(13187): Using debug level = 0 - Debug Enabled = 0
06-10 11:52:03.578: D/SKMaps(13187): MapRenderer----onSurfaceCreated
06-10 11:52:03.583: D/SKMaps(13187): MapRenderer---- LinInitialized = true 

06-10 11:52:03.643: A/libc(13187): Fatal signal 11 (SIGSEGV) at 0x0000000c (code=1), thread 13245 (Thread-584)

06-10 11:52:03.668: D/SKMaps(13187): SKVersionManager---- newversioncallback updatemapversionstatus=0
06-10 11:52:03.668: D/SKMaps(13187): SKVersionManager----Version file update status = 0  success 
06-10 11:52:03.668: D/SKMaps(13187): SKVersionManager----Request done at  startup 
06-10 11:52:03.668: D/SKMaps(13187): SKVersionManager----Current version is 0
06-10 11:52:03.668: D/SKMaps(13187): SKVersionManager----Current maps version is 0 => must update it to the last remote maps version

Debugging logs show more info about the error:

06-10 11:52:03.773: I/DEBUG(1825): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000c
06-10 11:52:03.978: I/DEBUG(1825): backtrace:
06-10 11:52:03.978: I/DEBUG(1825):     #00  pc 0029e35c  /data/data/com.kolobee.mini/lib/libngnative.so (WorldTextures::LoadTextures(float*, int, bool)+316)
06-10 11:52:03.978: I/DEBUG(1825):     #01  pc 0029e33c  /data/data/com.kolobee.mini/lib/libngnative.so (WorldTextures::LoadTextures(float*, int, bool)+284)

What could be causing this error?

I made an error while setting the resources path instead of:

File externalDir = getExternalFilesDir(null);
if (externalDir != null) {
    mapResourcesDirPath = externalDir + "/SKMaps/";
} else {
    mapResourcesDirPath = getFilesDir() + "/SKMaps/";
}

I had:

File externalDir = getExternalFilesDir(null);
if (externalDir != null) {
    mapResourcesDirPath = externalDir + "/SKMaps";
} else {
    mapResourcesDirPath = getFilesDir() + "/SKMaps";
}

Forgetting the trailing / on the path was producing the error. This was very difficult to find.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM