osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.64k stars 1.01k forks source link

SDcard not usable after Update from Marshmallow to Nougat #3301

Closed 1aladdin1 closed 7 years ago

1aladdin1 commented 7 years ago

My config is: HTC One M8 with 64GB external SDcard (exFAT file system); Cyanogenmod 13 (android marshmallow); offline maps located on external SD i.e. 'data storage folder' set to 'external storage 2'; using current version of OSMand+ from google play store. This worked flawless for a long time.

After recent update to Cyanogenmod 14.1 (android nougat) data storage folder was set to 'external storage 1', which in fact points to a partition of internal MMC of my M8. Of course my map files were not found there. So I tried to revert setting 'data storage folder' back to 'external storage 2' /storage/XXXX-XXXX/Android/data/net.osmand.plus/files. This unfortunately results in error message 'Maps could not be created in specified directory'. So it seems that I am also affected by the well known difficulties accessing external SD, since I updated to android nougat.

I tried to analyze this using logcat and compared the situation with cm13 to cm14.1 logcat.zip There are suspicious warnings from android packagemanager PackageManager: Not granting permission android.permission.WRITE_EXTERNAL_STORAGE to package net.osmand.plus because it was previously installed without. These warnings are (i) not unique to osmand and (ii) also occur in cm13. The only difference is that in cm13 these warnings occur only once, but twice in cm14.1

I already tried various suggestions given in related thread #1838 but without success. Any help or instructions for further analysis welcome!

Perhaps OSMand needs to be updated according to https://developer.android.com/training/articles/scoped-directory-access.html

scaidermern commented 7 years ago

Did you try going to OsmAnd app info and granting the rights for external storage manually?

1aladdin1 commented 7 years ago

@scaidermern yes I did - exactly spoken the app had already all permissions granted

1aladdin1 commented 7 years ago

In the meantime my issue seems to be resolved by an OS update. I had the issue using an inofficial build of cyanogenmod 14.1 Today I updated to recent official cyanogenmod nightly ... and the problem with write access to SD card is gone :-)