my full project (unable to open .map file)

45 views
Skip to first unread message

Donald Kariro

unread,
May 23, 2014, 8:57:42 AM5/23/14
to nutit...@googlegroups.com

Jaak Laineste (Nutiteq)

unread,
May 23, 2014, 9:37:50 AM5/23/14
to nutit...@googlegroups.com
Hello,

The problem seems to be in application permissions, instead of 
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

you should have:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Changing this made routing work in your app

By the way, the hint was in following line in Logcat.

05-23 16:28:40.288: E/graphhopper(18718): java.io.FileNotFoundException: /sdcard/mapxt/graphopper/ontario-gh/edges: open failed: EACCES (Permission denied)


Jaak


On 23 May 2014, at 15:57, Donald Kariro <don...@upande.com> wrote:


--
You received this message because you are subscribed to the Google Groups "Nutiteq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nutiteq-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

don...@upande.com

unread,
May 23, 2014, 10:21:38 AM5/23/14
to nutit...@googlegroups.com


On Friday, May 23, 2014 9:37:50 AM UTC-4, Jaak Laineste wrote:
Hello,

The problem seems to be in application permissions, instead of 
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

you should have:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Changing this made routing work in your app

By the way, the hint was in following line in Logcat.

05-23 16:28:40.288: E/graphhopper(18718): java.io.FileNotFoundException: /sdcard/mapxt/graphopper/ontario-gh/edges: open failed: EACCES (Permission denied)


Jaak


On 23 May 2014, at 15:57, Donald Kariro <don...@upande.com> wrote:


Hi Jaak, i still have the same problem even after changing the app permissions. and by the way there is no where the above line that you have mentioned is shown in my logs. i am wondering, where else did you change in code, or what is the difference between my development environment and yours? thanks..
 

Jaak Laineste (Nutiteq)

unread,
May 23, 2014, 10:41:12 AM5/23/14
to nutit...@googlegroups.com
The only other place what I changed was path to the data file, to reflect gh file folder on my device.

Jaak

don...@upande.com

unread,
May 26, 2014, 5:26:26 AM5/26/14
to nutit...@googlegroups.com

The only other place what I changed was path to the data file, to reflect gh file folder on my device.


Jaak

hi Jaak, what else could be the problem, it is just not working with me!

Jaak Laineste

unread,
May 26, 2014, 5:58:00 AM5/26/14
to nutit...@googlegroups.com
Without seeing all your logs and device contents it is quite impossible to tell. After setting permission it works fine for me.

Jaak

Donald Kariro

unread,
May 27, 2014, 4:12:41 AM5/27/14
to nutit...@googlegroups.com


On Monday, May 26, 2014 12:58:00 PM UTC+3, Jaak Laineste wrote:
Without seeing all your logs and device contents it is quite impossible to tell. After setting permission it works fine for me.

Jaak


hi Jaak, the following is my error log, i have tried the app on several devices and it crushes on all of them, please help.

05-27 04:05:59.680: E/AndroidRuntime(1373): FATAL EXCEPTION: main
05-27 04:05:59.680: E/AndroidRuntime(1373): Process: upande.don.upandenav, PID: 1373
05-27 04:05:59.680: E/AndroidRuntime(1373): java.lang.RuntimeException: Unable to start activity ComponentInfo{upande.don.upandenav/upande.don.upandenav.GraphhopperRouteActivity}: java.lang.IllegalStateException: no map file is currently opened
05-27 04:05:59.680: E/AndroidRuntime(1373):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at android.os.Handler.dispatchMessage(Handler.java:102)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at android.os.Looper.loop(Looper.java:136)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at android.app.ActivityThread.main(ActivityThread.java:5017)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at java.lang.reflect.Method.invokeNative(Native Method)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at java.lang.reflect.Method.invoke(Method.java:515)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at dalvik.system.NativeStart.main(Native Method)
05-27 04:05:59.680: E/AndroidRuntime(1373): Caused by: java.lang.IllegalStateException: no map file is currently opened
05-27 04:05:59.680: E/AndroidRuntime(1373):     at org.mapsforge.map.reader.MapDatabase.getMapFileInfo(MapDatabase.java:238)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at upande.don.upandenav.GraphhopperRouteActivity.onCreate(GraphhopperRouteActivity.java:142)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at android.app.Activity.performCreate(Activity.java:5231)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
05-27 04:05:59.680: E/AndroidRuntime(1373):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
05-27 04:05:59.680: E/AndroidRuntime(1373):     ... 11 more

Jaak Laineste (Nutiteq)

unread,
May 27, 2014, 4:59:25 AM5/27/14
to nutit...@googlegroups.com
The error message should be quite accurate, it means that map file is not opened when it is needed. You should trace application flow (with debugger and additional logging perhaps) before this error line, and check whether all operations regarding map file opening were completed successfully. If not, then check why - is working file present in expected location, is it opened successfully in read-write mode etc. Check if some other apps (graphhopper own demo app, or advancedmap3d) open same .map file and graphhopper files - if not then file contents could have problems.

Jaak
Reply all
Reply to author
Forward
0 new messages