Opened 4 years ago
Closed 22 months ago
#11753 closed defect (fixed)
BACKENDS: ANDROID (10+ / API 29+) - external storage is no longer browsable
Reported by: | antoniou79 | Owned by: | lephilousophe |
---|---|---|---|
Priority: | high | Component: | Port: Android |
Version: | Keywords: | API 29, Android 10, Android 11, File access, External Storage, Scoped Storage | |
Cc: | Game: |
Description
Starting November 2nd 2020 all app updates on the Play Store must target API 29 or higher (https://developer.android.com/distribute/best-practices/develop/target-sdk):
Note: From 2 November 2020, app updates must target Android 10 (API level 29) or higher.
However:
- API level 29 introduces some strict file access policies, and certain functions that we were using to browse external (to our app) folders, will be now returning null/ empty lists.
- See post https://forums.scummvm.org/viewtopic.php?p=89631#p89631 by forum member Vince (on Android 10).
My current physical devices go only up to API level 28. I can only test on emulated devices for higher API level, but this is not as fast and it's kind of harder to catch such issues.
For example, I have set up a Android x86 emulated device running on API 30 (Android 10.0+) but the folders in the emulated SD Card can be seen (unlike the screenshots provided by forum member Vince). However, their contents are not listed and choosing a valid game folder does not result in adding the game but rather to the error "ScummVM could not find any game in the specified directory!"
For the moment we're back to targeting API 28 (Android 9). This is set in build.gradle as "targetSdkVersion"
References I found for figuring out a possible solution:
https://developer.android.com/about/versions/10/privacy/changes
https://developer.android.com/about/versions/11/privacy/storage
https://www.raywenderlich.com/9577211-scoped-storage-in-android-10-getting-started
https://developer.android.com/training/data-storage#scoped-storage
https://android.jlelse.eu/handling-files-in-code-after-the-android-10-released-2bea0e16d35
https://stackoverflow.com/questions/57449242/android-q-10-ask-permission-to-get-access-all-storage-scoped-storage
Attachments (2)
Change History (5)
by , 4 years ago
Attachment: | Screenshot-2020-10-04-10-12-42-137-org-scummvm-scummvm-01.jpg added |
---|
by , 4 years ago
Attachment: | Screenshot-2020-10-04-10-12-29-351-org-scummvm-scummvm-01.jpg added |
---|
comment:1 by , 4 years ago
Summary: | ANDROID: On Android 10+ (API 29+) external storage is no longer browsable → BACKENDS: ANDROID (10+ / API 29+) - external storage is no longer browsable |
---|
comment:2 by , 22 months ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → pending |
comment:3 by , 22 months ago
Status: | pending → closed |
---|
This should be fixed by PR #4602.
More tests are welcome.