osmandapp / OsmAnd

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

4.1 The folder migration process doesn't work on my phone #13352

Open julienw opened 2 years ago

julienw commented 2 years ago

Description

After loading latest version of osmand, I get the folder migration, because I was using a folder on my sdcard previously. However it's not working as expected. I click the button to select a folder and get the root directory. I tried to create a new folder named Osmand, gave the authorization to the app, but then got an error. I'm not sure what I should do to finish this migration'm and use the app without losing the data. Thanks !

How to reproduce?

Start the new version of osmand.

Your Environment

OsmAnd Version: 4.1.10 Android/iOS version: android 11 Device model: Samsung Galaxy S10e

Maps used (online or offline): offline If you have an issue related to offline maps, tell us the exact name of the map file where the issue occurs and its edition date.

vshcherb commented 2 years ago

In new version you can use only Multi User Storage, so you can access and copy files to it. If migration process fails, your files will be located at the old location and you can move it to a new path via File Manager (check the path in OsmAnd Settings -> Storage)

julienw commented 2 years ago

thanks @vshcherb!

To be more explicit, I opened this issue to:

  1. Let you know that the migration process doesn't work properly on my phone and my environment.
  2. Know what to do (esp: what is the folder I should pick?), because currently I can't use the awesome piece of software that's known as osmand :-(

thanks

tommycrock commented 2 years ago

I seem to have a related problem. #13389

sonora commented 2 years ago

The issues are different, though. This one describes google's intended behavior of Android 11 that apps targeting SDK 30 can only write to their respective subfolder of /Android/data on external (removable or non-removable) storage. The creation of custom folders is suppressed, and existing custom folders can only be read-accessed to facilitate one-time migration under certain circumstances. As part of enforcing things, google mandates app updates published on the Play Store since November 1 to target SDK 30, i.e. provokes exactly this new behavior for any updated app under Android 11.

Issue #13389, on the other hand, describes the attempt to use one of very few documented exception mechnisms, using the system Download folder instead. In that case I believe google's library approach makes each file under Download visible only to exactly the app which had created it. I am not sure why visibility would break between the OsmAnd version changing from 4.1.9 to 4.1.10, that may be a glitch which could be fixed, not sure. In any case, however, from what I see using a subfolder of Download is likely no viable workaround for any related issue google has introduced in Android 11.

tommycrock commented 2 years ago

Thanks @sonora

Like @julienw folder migration doesn't work for me also. I was also confused by @vshcherb suggestion to use a file manager to move the files. As you said osmand won't be able to use the files if it hasn't written them. Perhaps I misunderstand.

julienw commented 2 years ago

Currently I've done nothing yet about the migration and I'm afraid of doing anything at the risk of having an unusable app. As a result I don't use OSMAnd now and I'm very sad about this situation :-)

Could someone please just advise what the best way forward is?

scaidermern commented 2 years ago

A user in https://t.me/OsmAndMaps reported that the migration didn't work for him. After migration the maps were located at "SD card/Android/media/net.osmand.plus/" but the tracks at "SD card/Android/obb/net.osmand.plus/".

vshcherb commented 2 years ago

Currently I've done nothing yet about the migration and I'm afraid of doing anything at the risk of having an unusable app.

There is no such risk. You need to save most important data I think favorites / tracks, locate them with File manager and create the copy. After that you can do clean installation or migration and always later copy files to the target directory

hrehfeld commented 2 years ago

Migration broke my osmand as well.

All the data was root-accessible here: /data_mirror/data_ce/null/0/net.osmand.plus/no_backup/net.osmand.plus/ and I could simply copy it to the sd card.

I'm now successfully using data from the Android/media folder on the sd-card.

julienw commented 2 years ago

My process that actually worked without manually :

  1. click "ignore" on the initial dialog.
  2. go to the parameters to the storage folder parameter
  3. Here, select one of the proposed folders

=> the migration process kicks in, and after a while I now have a functioning osmand.

The migration process was very smooth. But I don't understand why I get a different non-working dialog at load time?

update: actually not all maps were copied, not sure why?