Sample TileStore crash

50 views
Skip to first unread message

Max

unread,
Oct 16, 2014, 9:32:25 AM10/16/14
to mapsfo...@googlegroups.com
Hello,

I launched the Sample application TileStoreViewer with Mapsforge 0.5 RC2
It crash with the following error:

10-16 15:16:08.080: E/AndroidRuntime(26665): FATAL EXCEPTION: main
10-16 15:16:08.080: E/AndroidRuntime(26665): Process: org.mapsforge.applications.android.samples, PID: 26665
10-16 15:16:08.080: E/AndroidRuntime(26665): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.mapsforge.applications.android.samples/org.mapsforge.applications.android.samples.TileStoreLayerViewer}: java.lang.IllegalArgumentException: Root directory must be readable
10-16 15:16:08.080: E/AndroidRuntime(26665): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
10-16 15:16:08.080: E/AndroidRuntime(26665): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350)
10-16 15:16:08.080: E/AndroidRuntime(26665): at android.app.ActivityThread.access$800(ActivityThread.java:163)
10-16 15:16:08.080: E/AndroidRuntime(26665): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257)
10-16 15:16:08.080: E/AndroidRuntime(26665): at android.os.Handler.dispatchMessage(Handler.java:102)
10-16 15:16:08.080: E/AndroidRuntime(26665): at android.os.Looper.loop(Looper.java:157)
10-16 15:16:08.080: E/AndroidRuntime(26665): at android.app.ActivityThread.main(ActivityThread.java:5335)
10-16 15:16:08.080: E/AndroidRuntime(26665): at java.lang.reflect.Method.invokeNative(Native Method)
10-16 15:16:08.080: E/AndroidRuntime(26665): at java.lang.reflect.Method.invoke(Method.java:515)
10-16 15:16:08.080: E/AndroidRuntime(26665): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
10-16 15:16:08.080: E/AndroidRuntime(26665): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
10-16 15:16:08.080: E/AndroidRuntime(26665): at dalvik.system.NativeStart.main(Native Method)
10-16 15:16:08.080: E/AndroidRuntime(26665): Caused by: java.lang.IllegalArgumentException: Root directory must be readable
10-16 15:16:08.080: E/AndroidRuntime(26665): at org.mapsforge.map.layer.cache.TileStore.<init>(TileStore.java:59)
10-16 15:16:08.080: E/AndroidRuntime(26665): at org.mapsforge.applications.android.samples.TileStoreLayerViewer.createTileCaches(TileStoreLayerViewer.java:83)
10-16 15:16:08.080: E/AndroidRuntime(26665): at org.mapsforge.applications.android.samples.BasicMapViewer.onCreate(BasicMapViewer.java:330)
10-16 15:16:08.080: E/AndroidRuntime(26665): at android.app.Activity.performCreate(Activity.java:5389)
10-16 15:16:08.080: E/AndroidRuntime(26665): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
10-16 15:16:08.080: E/AndroidRuntime(26665): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256)
10-16 15:16:08.080: E/AndroidRuntime(26665): ... 11 more

It's on a Galaxy Note3, external storage is readable...
I will notifiy also that I don't get the warning message at the first laucnh of the TileStoreViewer which normally notify to put data on disk.

Regards,

Max.

Ludwig

unread,
Oct 16, 2014, 9:35:21 AM10/16/14
to mapsfo...@googlegroups.com

I guess you do not have any data installed.
Technically, it pops up a msg to that regard but actually it crashes before the msg is shown.
There is a tile store in the data section of the samples app

--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/3d67263f-b7af-41e1-ba64-258859caf149%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Emux

unread,
Oct 16, 2014, 9:43:01 AM10/16/14
to mapsfo...@googlegroups.com
I think the Environment.getExternalStorageDirectory() answers with what the device has defined as external storage.
And depending on the device it's not always the external sd card.

--
Emux
Cruiser - Atlas

Max

unread,
Oct 16, 2014, 10:04:56 AM10/16/14
to mapsfo...@googlegroups.com
What disturbed me is that I never got the message which normally warning the user to put data on disk...
As it crash before this message, I never put the TileStore for test.... :|

I'm aware that Environment.getExternalStorageDirectory() return directory dependent of the device configuration and the presence of external SDCard or not...

PS: Nothing to do there but to notify:

In version of Android 4.4, 'KitKat', Google has modified the default permissions for the external SD Card. Now it is accessible for writing only by a special user group of members called media_rw. 
Before that when some process needs to write to external media, it requests the appropriate permission. 
This was the usual behavior in earlier versions of Android. However, third-party apps in KitKat have no access to that permission!

So  for the moment the TileStore only do read operation, but if at any time it need to write (for example for store new tile or cache something) then it cannot be stored in ExternalSd card anymore...

I think it's a pitty but probably was done for limit application to store data anywhere in the storage and then stay indefinately even after uninstall the app....

Regards.

 

Emux

unread,
Oct 16, 2014, 1:02:00 PM10/16/14
to mapsfo...@googlegroups.com
We probably should perform more checks about external storage (the manifest already has the proper permissions).

Also I see that the message is shown at onResume but the TileStore is created earlier at onCreate, that's the reason the exception comes first.

Reply all
Reply to author
Forward
0 new messages