heremaps / here-android-sdk-examples

Java-based projects using the HERE SDK for Android.
Apache License 2.0
146 stars 191 forks source link

Cannot create map: Failed to read configuration file #436

Closed mrvdongen closed 3 years ago

mrvdongen commented 3 years ago

Hello,

I'm trying to fix an issue where the app crashes when the map data is installed on the SD card. when using the default internal storage it all works fine.

Also its working fine on some android 10 users and some users crash.

crash data: java.lang.RuntimeException: Cannot create map: Failed to read configuration file: /storage/1112-0C10/Android/data/com.myrouteapp.navigation/files/here-cache/155d1c77c33151770c37499776d9c42f/mwconfig_client at com.nokia.maps.MapImpl.<init>(MapImpl.java:3356) at com.here.android.mpa.mapping.Map.<init>(Map.java:2) at com.nokia.maps.a2.a(MapFragmentImpl.java:78) at com.nokia.maps.a2.a(MapFragmentImpl.java:121) at com.nokia.maps.a2.a(MapFragmentImpl.java:1) at com.nokia.maps.a2$a.onEngineInitializationCompleted(MapFragmentImpl.java:3) at com.nokia.maps.MapsEngine$j.run(MapsEngine.java:2) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

code preview:

File[] dirs = context.getExternalFilesDirs(null); if (dirs.length> 1) { File sdLocation = new File(dirs[1], "here-cache"); com.here.android.mpa.common.MapSettings.setDiskCacheRootPath(sdLocation.getAbsolutePath()); } else { com.here.android.mpa.common.MapSettings.setDiskCacheRootPath(storageDir); }

Any help would be greatly appreciated.

NazarKacharaba commented 3 years ago

This issue is fixed in the latest SDK 3.18.3 release.