Can not import or export logged sessions on Android 10+ #74
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: tslocum/meditationassistant#74
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With the current version, I can not import or export logged sessions locally.
When I try to export/import session, I can't see any directories (screenshot 1).
When I try to export sessions, I get an error message (screenshot 2).
Storage permissions are granted. Revoking and granting permissions again does not change anything.
I am using a Galaxy S10e with the lastest OS updates installed.
Pleasi let me know what additional information I could or should provide in order to find out what's wrong.
Thanks for reporting this. Will you confirm that /storage/emulated/0 does exist on your device with a file manager?
I have looked into the details of an existing file and the file path indicates that /storage/emulated/0 does indeed exist.
Thanks @fwuestner. Please go to the app info page for Meditation Assistant (hold the app icon and tap info), select Permissions and let me know if the Storage permission is granted already. If it was not granted yet, try granting it and force stop the application or restart your device before relaunching.
Permissions are granted, here is a screenshot of that Screenshot_20200506-080802_Permission_controller
Revoking and granting permission again, force closing the app or even reinstalling the app entirely does not change the issue, unfortunately it still persists.
I am also getting this issue after "upgrading" to Android 10. I have very little Android development experience, but I can look into why this is occurring if you are unlikely to get chance to do it soon @tslocum?
Hey @oakular, I am glad for any help from others, even if it is research on a solution which I can then follow up on and implement
@tslocum I forked the repo, and had a look at the code; I think the issue originates from the file picker activity itself. I'm not sure if it is worth replacing this activity with the native android file browser for Android 10 and up? It looks like the developer for the picker even suggests doing so for Android 6 and above.
What do you think?
closed via commit
3bc4338959
Thanks @oakular. Using the native file picker in Android 6.0+ seems to work. I've released version 1.6.0 with this fix.
Thanks for the fix! The file chooser works now.
Unfortunately, importing and exporting is still not working.
When trying to export, I can choose the location and name of the file, but as soon as I accept, the application crashes and an empty .cvs is created (size of 0B).
Importing existing tables that were exproted in a previous version are not imported either. It seems to go through without any issues, but when I check the progress, the imported sessions do not show up.
I paid attention to the correct format (UTC/local).
Thanks @ysooqe. Will you please let me know which version of Android you are using? I will look into this further.
@tslocum Sure! Sorry, I probably should have mentioned this already. I am using Android 10 on Samsung device.
@tslocum can confirm I'm also seeing the same behaviour here; file picker loads fine, but no sessions are imported.
changed title from Can not import or export logged sessions to Can not import or export logged sessions{+ on Android 10++}
reopened
From what I can tell this is due to storage access changes in Android 10. I've tried several solutions found on Stack Overflow but I am still running into this issue. Assistance from another developer who is familiar with the new storage framework would be appreciated. To be specific, choosing a file results in a content: URI which doesn't seem to be writable.
Samsung Galaxy S10e user here, running Android 10 Samsung build QP1A.190711.020.G970USQS4DTG1 (8/2020 security patch level). Running Meditation Assistant 1.6.0 installed from F-Droid.
Not quite a fix, but a workaround:
If I create a folder "/storage/emulated/0/Android/data/sh.ftp.rocketninelabs.meditationassistant.opensource" and ask Meditation Assistant to export a session log there, the file is exported successfully. I've had to use a similar trick to allow other apps to write to the SD Card in the past. Perhaps Android 10 has extended this limitation, at least of content: URIs, to Internal Storage as well?
@jonkeim If you don't mind me asking, how did you create that folder with the proper permissions and ownership? If I try to create it with a file manager, I still can not export any files there, which I believe is due to the fact that the folder is not owned by the application. How could I achieve that?
On my phone, Android itself seems to take care of assigning the correct owner to that folder. I just used a file manager to do it, too. The folder name needs to match the App's package name exactly, though.
The app's package name is different depending on where you installed the app from. I got mine from F-Droid. If you got your copy from the Google Play Store, it looks like you need to name the folder either "sh.ftp.rocketninelabs.meditationassistant" or "sh.ftp.rocketninelabs.meditationassistant.full". Use the latter if you bought the "donate" edition.
(You can find a package's name by finding the app on the Play Store's website. For example: https://play.google.com/store/apps/details?id=sh.ftp.rocketninelabs.meditationassistant .)
Thank you for your answer! I can confirm, using the same phone (only with a newer software build, security patch from 09/2020), it does work indeed.
I also tested importing a file. If it is located in that folder, importing sessions works as expected.
I think I am getting the same error, although sometimes the app crashes before I get any error message and an empty file of 0 bytes is created.
Default location when I press export is the
Downloads
folder. This is where the app will crash. When I try to save in the base directory, I get the error message that others get as well.It appears I can't do the workaround. The default Files app doesn't allow me to create the directory (maybe because my phone isn't rooted?). I was able to create it from my computer, but I cannot access the
Android/data
folder when trying to export. It just doesn't show up inside theAndroid
folder. Trying to create a newdata
folder results in it being nameddata (1)
so it's obviously just Android which is preventing me from accessing it.Update:
Putting the folder in
Android/media
does the trick and I can export.mentioned in merge request !6
mentioned in issue #85
Please confirm whether this is resolved in version 1.6.4.
@tslocum I just tried exporting data to a standard directory (e.g. "Downloads") and that seems to work! Awesome!