org.mapsforge.map.reader.header.MapFileException: file does not exist

Hi,
i created offline map using mauritania.map from mapsforge server then got others file from Cruise App but found this error on android studio
org.mapsforge.map.reader.header.MapFileException: file does not exist: /data/user/0/offline.app.rep.offlinemap/files/grasshopper/mauritania.map

If you are sure the file exists with this code:

File(“/data/user/0/offline.app.rep.offlinemap/files/grasshopper/mauritania.map”).isFile() //¿returns true or not?

Then verify you can read the file:

File("/data/user/0/offline.app.rep.offlinemap/files/grasshopper/mauritania.map").canRead()

And if you cannot read, then you must enable READ_EXTERNAL_STORAGE permissions. Although due to the path you wrote, it seems you are reading from the local storage of your app. So you shouldn’t have this problem.

Thanks carlos for you response but the pb was solved it was permission pb but i faced another pb when i calculate the distance between two point in order to draw the path : java.lang.IllegalStateException: Cannot load properties to fetch EncodingManager configuration at: /storage/emulated/0/Download/grasshopper/ the files properties.config exist in my folder

1 Like