-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MediaStore lost access to files after uninstalling the app or clearing its data #103
Comments
I'm also able to reproduce these two issues. But, if you try to use another name, e.g. FYI, if you uninstall the app, then all of your files created with This issue can't be fixed from my side, but I'll leave it open until Android team resolve it. I'll raise this issue on Google Issue Tracker and will put the link here soon. |
I'm trying to implement a |
I didn't find any article about |
@anggrayudi Its my own custom class that behaves like |
I encountered the same issue, as discussed in lolo-io/OneList#41 (comment) . The problem is that This helper function tries to use a DocumentFile, and if it fails, it uses a MediaStore to create or reuse a file. I noticed that in practice, it always uses a DocumentFile. All my attempts at using a DocumentFile manually just miserably failed: I will ask another related question elsewhere, but the culprit is that it appears that all the DocumentFile and DocumentFileCompat functions are now broken. So this issue needs fixing. |
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION can solve your problem from api 30 and above |
Your app will be refused from Play Store if you use this permission.
23 mars 2023 06:13:50 Nguyễn Minh Khoa ***@***.***>:
…
ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION can solve your problem from api 30 and above
—
Reply to this email directly, view it on GitHub[#103 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAIRFXSZ4P4TEXHCIXONITDW5PLY5ANCNFSM6AAAAAARZKBZP4].
You are receiving this because you commented.[Image de pistage][https://github.com/notifications/beacon/AAIRFXQ3DFP2MEADZ3KJPKTW5PLY5A5CNFSM6AAAAAARZKBZP6WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSYIBO7Q.gif]
|
Library version: 1.5.1
OS version: [Android 12]
Device model: [Emulator Pixel 5]
Describe the bug
I'm creating a txt file in Downloads folder with this code:
And I'm reading the file with this approach:
Everything works fine. But after I uninstall the app and reinstall it, when I call the
readConfig()
function, the file variable is null. and strange thing is that when i call thewriteToConfig()
function again, instead of reusing the same file it creates a new file with this name: "config-test (1).txt".So after I saw this, I tried to retest the code and I deleted the files (""config-test.txt" and "config-test (1).txt"). After force stopping and relaunching the app I got an Exception:
android.database.sqlite.SQLiteConstraintException
.After this exception you cant work with this code anymore and the only way to fix this crash is that you need to wipe data from your device settings.
So we have two bugs in here
To Reproduce
MediaStoreCompat
to write/read a file in Downloads folder.Stacktrace
The text was updated successfully, but these errors were encountered: