Closed andrewferguson closed 3 years ago
My guess that the file picker of your ROM is doing something wrong, since it works for me on v0.20.8 on an android 10 phone and an android 4.4 emulator
Can you try out the apk in https://github.com/TeamNewPipe/NewPipe/pull/6820 and see if that changes anything?
Have the same problem with LineageOS 14.1 (Android 7.1.2) and the default file manager (com.android.documentsui version 7.1.2). I believe it's a problem with the file manager (see workaround). @XiangRongLin Unfortunately the PR does not fix this issue. The contents of the zip are grayed out instead, that's it.
Workaround: I was able to import the database with "Material Files". After installing this file manager one gets asked which program should be used to import the database. Choose "Material Files" instead of the default system file manager. Note: Most other file managers do not work. (I guess they have to support the file open intent?)
Can you try
ACTION_GET_CONTENT
instead of ACTION_OPEN_DOCUMENT
which should be the correct value according to the doc, since we only want a one time permission to read the file https://developer.android.com/guide/topics/providers/document-provider.html#clientThanks for your suggestions. It seems that the file manager does not recognize zip files as files but as directories instead. So it could be a bug in my particular rom (very outdated and only for fooling around with android dev stuff).
Regarding 2: Long-pressing the zip and then tapping the appearing 'open' button works in the original app.
Regarding 1: The new apk does not make a difference. The file manager still enters the zip file and one can select both contained files individually. Interestingly, long-pressing the zip and then opening crashes with the new apk:
I'd close this: this issue has been reported before, but there's nothing we can do about it as it's the file manager's duty to display the correct options, and no workarounds are doable.
Regarding 2: Long-pressing the zip and then tapping the appearing 'open' button works in the original app.
You mean that it works, at least that way?
The easiest way to get past the issue is to downgrade to release 0.21.5
You can also just disable SAF in download settings
You mean that it works, at least that way?
Yes, that worked for me.
Checklist
Steps to reproduce the bug
Actual behaviour
During the import stage, rather than allowing the .zip file containing the exported DB to be selected, the file picker instead goes inside the .zip file, showing the exported files inside the zip file. Naturally, selecting one of these files results in the import failing as it is expecting a .zip file.
Expected behaviour
During the import stage, what should happen is that the file picker should allow the .zip file to be selected, to allow the import to succeed.
Screenshots/Screen recordings
Below is a screen recording of me:
https://user-images.githubusercontent.com/13520045/127225626-f80be85a-af97-417d-b08e-1fcb71ab1f37.mp4
Device info
Possible cause of the issue
My suspicion is that this issue is caused by the upgrade to the Storage Access Framework as part of 0.21.6.
How to get past the issue
The easiest way to get past the issue is to downgrade to release 0.21.5, where importing from a .zip still works fine. From there you can import the settings / history, then upgrade back to the latest release (since settings and history are preserved when upgrading through F-Droid repositories).