APK Downloader
·15 min read

Sideloaded APK Can't Read Photos: Granular Media Permissions and Partial Photo Access on Android 13/14

It installs, it launches, but the gallery is empty — or shows three photos — or crashes the moment you tap 'choose image.' That is usually not a broken APK; it is a permission-model gap. This guide maps every media-permission change from Android 11 through 15 into one comparison table, then walks through aapt, apkanalyzer, dumpsys, appops and logcat commands, a nine-step diagnostic path, an error-log lookup table and 10 FAQs so you can decide whether to re-grant, replace the package, or uninstall it.

media permissionsscoped storagePhoto PickerAndroid troubleshootingsideloading

The most confusing failure after sideloading an APK is not "it won't install." It is "it installed, the icon is there, the app opens — and the moment I try to set an avatar or attach a photo, the gallery is completely empty." You have two thousand photos on the device. The app shows none of them. Or it shows exactly the three screenshots you took this morning. Or tapping "choose image" kills the app instantly.

The natural reaction is to assume the download was corrupt and fetch it again. People re-download three times from three mirrors and nothing changes, because the file was never the problem. The problem is a permission-model generation gap. Between Android 11 and Android 15, Google rewrote "read the photo library" four times, while sideload channels still circulate a huge number of packages compiled around 2021 that never updated their targetSdk. On a modern system those packages are either silently granted a compatibility mapping, or they request a permission name that no longer does anything, or they bypass the system picker entirely and hit a wall.

This guide gives you a diagnostic path you can actually type. First, three read-only commands establish the three variables that decide everything: device API level × the package's targetSdk × the permissions it declares. Then you reproduce the failure and read the log to classify it. Finally you apply the fix that matches the root cause. No root required, and no system settings need to be changed permanently.

> If you have not installed yet and just want to know whether a package will behave on a newer device, start with the Android APK compatibility decision flowchart and the full verification workflow before you download. If the app is already in its observation window, pair this with the 48-hour post-install audit.

---

1. Separate the three kinds of "can't read photos" first

"Can't read photos" covers at least three unrelated failures, and the fixes are not interchangeable.

SymptomMost likely root causeFirst command to run
Gallery empty, no crash, nothing in the logDeclares the legacy READ_EXTERNAL_STORAGE, which grants nothing to a targetSdk >= 33 appapkanalyzer manifest permissions app.apk
Only a handful of photos appearAndroid 14 "select photos" was chosen; READ_MEDIA_VISUAL_USER_SELECTED is grantedadb shell dumpsys package <pkg> | grep -A2 READ_MEDIA
Crash on tapping the picker, SecurityException in logApp reads a raw /sdcard/DCIM path or calls a deprecated API without a permission checkadb logcat -d | grep -iE "SecurityException|READ_MEDIA"
Permission dialog offers three options (select photos / allow all / don't allow)Normal Android 14+ three-way dialog, not a faultadb shell getprop ro.build.version.sdk
No dialog at all, returns empty immediatelyThe app uses the system Photo Picker, but its system media component is unavailableadb shell am start -a android.provider.action.PICK_IMAGES

Classify your symptom into one row before going further. The \| in the table is a shell pipe — type it as | in a real terminal.

---

2. The mechanism: four rewrites from Android 11 to 15

Once you understand this table, every command output below explains itself.

Android (API)Correct way to read shared photosWhat changedEffect on older sideloaded packages
Android 10 (29)READ_EXTERNAL_STORAGE, with requestLegacyExternalStorage opt-outScoped storage introduced but escapableRaw path reads still work
Android 11 (30)READ_EXTERNAL_STORAGE plus MediaStore / SAFScoped storage enforced; requestLegacyExternalStorage only honored for targetSdk 29Hard-coded absolute paths start failing
Android 12 (31)Same as aboveWRITE_EXTERNAL_STORAGE becomes effectively meaningless; preserveLegacyExternalStorage only helps upgradesWrite-permission requests become no-ops
Android 13 (33)READ_MEDIA_IMAGES / READ_MEDIA_VIDEO / READ_MEDIA_AUDIOOne storage permission split into three; READ_EXTERNAL_STORAGE stops working for targetSdk >= 33The most common break point: the old name is requested and grants nothing
Android 14 (34)Those three plus READ_MEDIA_VISUAL_USER_SELECTEDNew "allow only selected photos" optionA single tap on "select photos" leaves the app seeing a few images
Android 15 (35)+Granular permissions plus the system Photo PickerThe picker becomes the recommended zero-permission pathPackages still using raw paths fail more often

Three details that are easy to miss:

  1. The compatibility mapping is real but incomplete. A package with targetSdk <= 32 running on Android 13+ gets READ_EXTERNAL_STORAGE mapped at install time to READ_MEDIA_IMAGES and READ_MEDIA_VIDEO. That is why plenty of old apps still work. But a package with targetSdk >= 33 that only declares the legacy permission gets nothing — the system will not fill in the blanks. That is exactly why "the same APK works on my old phone and shows an empty gallery on the new one."
  2. `READ_MEDIA_VISUAL_USER_SELECTED` is not just another permission flag. It means "the user picked only some photos" and is mutually exclusive with the full READ_MEDIA_IMAGES grant. When both appear in dumpsys, read the granted state to determine which scope is actually in force.
  3. Photo Picker needs no permission at all. On Android 13+ an app can start android.provider.action.PICK_IMAGES and receive only the URI the user selected in that moment, without declaring any READ_*. So "no permission dialog appeared" is not necessarily a failure — it can be the more correct implementation.

If the idea that a compile-time target changes runtime behavior is new, the package visibility and targetSdk 30 guide covers it in more depth; the same pattern shows up in exact alarm permissions and per-app language settings.

---

3. Six read-only commands before you touch anything

Put the APK in your current directory and confirm adb devices sees the phone. Everything here is read-only.

# 1) Which system generation is this? (decides which row of the table applies)
adb shell getprop ro.build.version.sdk
adb shell getprop ro.build.version.release

# 2) Which media permissions actually exist on this ROM?
adb shell pm list permissions | grep -i MEDIA

# 3) What does the APK declare, without installing it?
aapt dump permissions app.apk
# On newer SDK builds, apkanalyzer shows the merged manifest:
apkanalyzer manifest permissions app.apk

# 4) The two variables that decide everything: targetSdk and package name
apkanalyzer manifest target-sdk app.apk
apkanalyzer manifest application-id app.apk

# 5) Does the archive contain native libs? (useful for spotting repacks / multi-ABI builds)
unzip -l app.apk | grep -E "lib/|AndroidManifest.xml"

# 6) If already installed, what did the system actually grant?
adb shell dumpsys package com.example.app | grep -A3 -i "READ_MEDIA\|READ_EXTERNAL_STORAGE"

Step 4 is the watershed. If target-sdk is 32 or lower while the device reports 34, you are on the compatibility-mapping branch. If it is 33+ but step 3 shows only READ_EXTERNAL_STORAGE, you can conclude immediately that the package was never adapted — reinstalling it a hundred times will not help.

> aapt dump permissions and apkanalyzer manifest permissions format their output differently, and the latter reflects the merged final manifest including permissions pulled in by library modules. When they disagree, trust apkanalyzer.

---

4. The nine-step diagnostic path

Each step includes the expected output and the branch to take.

Step 1 — Confirm the device API level

adb shell getprop ro.build.version.sdk

33 → granular permissions apply. 34/35 → also check partial access. 30–32 → the permission model is probably not the issue; skip to step 6 and look at scoped-storage paths.

Step 2 — Confirm the package's targetSdk

apkanalyzer manifest target-sdk app.apk
apkanalyzer manifest application-id app.apk

Write down the package name; every following step needs it. Below 33, put the compatibility mapping at the top of your suspect list.

Step 3 — Confirm the declared permissions

apkanalyzer manifest permissions app.apk
aapt dump badging app.apk | grep -i "uses-permission"

Expect at least android.permission.READ_MEDIA_IMAGES for an image-handling app. If you only see READ_EXTERNAL_STORAGE / WRITE_EXTERNAL_STORAGE, the package does not support Android 13+. That is a package problem: get a newer build or a different source, and do not waste time on grants. The install-failed error code reference is useful for telling this apart from an outright corrupt archive.

Step 4 — Confirm the runtime grant state

adb shell dumpsys package com.example.app | grep -A4 "requested permissions"
adb shell dumpsys package com.example.app | grep -E "READ_MEDIA|READ_EXTERNAL"

Only granted=true counts. If READ_MEDIA_IMAGES appears under requested permissions with granted=false, the user denied it or the dialog never fired.

Step 5 — Check whether AppOps quietly overrides the grant

adb shell appops get com.example.app
adb shell cmd appops get com.example.app READ_MEDIA_IMAGES

Android keeps a second enforcement layer called AppOps on top of runtime permissions. Some vendor ROMs and device policies set READ_MEDIA_IMAGES to ignore, in which case dumpsys says granted and the app still sees nothing. This is the most commonly skipped layer. For a related "permission looks granted but does nothing" case, see restricted settings and accessibility on sideloaded apps.

Step 6 — Reproduce and capture the log

adb logcat -c
# On the phone: open the app, tap "choose image"
adb logcat -d -v brief | grep -iE "SecurityException|READ_MEDIA|MediaStore|PhotoPicker|EACCES"

See the lookup table in section 6. java.lang.SecurityException: Permission ... READ_MEDIA_IMAGES means the app asked and did not get it. EACCES (Permission denied) with a path like /storage/emulated/0/DCIM/... means it is reading a raw absolute path, which scoped storage always blocks.

Step 7 — Distinguish partial access from a flat denial

adb shell dumpsys package com.example.app | grep -A2 "READ_MEDIA_VISUAL_USER_SELECTED"

If this is granted=true, the user originally chose "select photos only." The app can see just the media items ticked in the system picker — hence "only three photos." Fix it in Settings → Apps → Permissions → Photos and videos → "Allow all," or re-grant with adb (section 7).

Step 8 — Verify the system Photo Picker exists

adb shell am start -a android.provider.action.PICK_IMAGES -t "image/*"

If the system picker opens, the zero-permission path is available and well-behaved apps should use it. Error: Activity not found means the device's media component is older; apps relying on Photo Picker fall back to their own gallery implementation, so go back to step 3 and confirm they requested the granular permissions.

Step 9 — Verify the fix

# Re-grant full photo access (replace <pkg> with the value from step 2)
adb shell pm revoke com.example.app android.permission.READ_MEDIA_VISUAL_USER_SELECTED
adb shell pm grant  com.example.app android.permission.READ_MEDIA_IMAGES
adb shell pm grant  com.example.app android.permission.READ_MEDIA_VIDEO
adb shell am force-stop com.example.app

Reopen and reproduce. Back to normal → it was a grant-state issue. Still empty with no exception → back to step 3, replace the package. New SecurityException → the app mishandles the partial-access state, which is an app bug; capture the stack trace and compare it against the install and runtime error reference.

---

5. Command quick-reference

GoalCommandWhat to read
Device generationadb shell getprop ro.build.version.sdk33+ granular, 34+ partial access
Package targetapkanalyzer manifest target-sdk app.apk>=33 with only legacy permission = unadapted
Declared permissionsapkanalyzer manifest permissions app.apkLook for the three READ_MEDIA_*
ROM permission listadb shell pm list permissions | grep -i MEDIAIs VISUAL_USER_SELECTED present?
Grant stateadb shell dumpsys package <pkg> | grep -A4 "requested permissions"granted=true
Hidden restrictionadb shell appops get <pkg>ignore overrides a granted permission
Crash logadb logcat -d | grep -iE "SecurityException|EACCES""no permission" vs "wrong path"
Picker availabilityadb shell am start -a android.provider.action.PICK_IMAGESActivity not found = old system component
Re-grantadb shell pm grant <pkg> android.permission.READ_MEDIA_IMAGESforce-stop after granting
Revoke partialadb shell pm revoke <pkg> android.permission.READ_MEDIA_VISUAL_USER_SELECTEDMutually exclusive with full grant

---

6. Error-log lookup table

Log fragmentWhat it really meansAction
SecurityException: ... READ_MEDIA_IMAGESRequested but not grantedSteps 4/5 for grants and AppOps, step 9 to re-grant
EACCES (Permission denied) with /sdcard/DCIM pathRaw absolute path under scoped storageApp defect — replace it, or use MediaStore / SAF
IllegalArgumentException: ... READ_EXTERNAL_STORAGEtargetSdk >= 33 requesting a dead permissionUnadapted package, get a newer build
Cursor returned null / query returns 0 rowsNo permission, or an empty partial-access selectionStep 7, check VISUAL_USER_SELECTED
Activity not found: PICK_IMAGESSystem media component lacks the pickerApp must fall back to granular permissions
No exception at all, purely blank UIOften reads a cache dir or uses a hard-coded queryRule out a truncated archive with the install troubleshooting reference

---

7. Pick the fix that matches the root cause

Class A — the package was never adapted (most common, and the one not worth forcing).

Signs: target-sdk >= 33, permissions containing only READ_EXTERNAL_STORAGE. The package is missing the capability by design. Your only real options are an official newer build, an adapted repack, or an older device. To check whether the file was tampered with, see the full verification workflow and scan an APK for malware without an antivirus. For deciding whether a source is trustworthy at all, use the compatibility check before download.

Class B — the user chose "select photos only."

Signs: READ_MEDIA_VISUAL_USER_SELECTED is granted=true and only a few images appear. Two routes:

# Option 1: command line, no need to open Settings
adb shell pm revoke com.example.app android.permission.READ_MEDIA_VISUAL_USER_SELECTED
adb shell pm grant  com.example.app android.permission.READ_MEDIA_IMAGES
adb shell am force-stop com.example.app

Option 2: Settings → Apps → the app → Permissions → Photos and videos → "Allow all." Some vendors bury this under "Permission manager → Special access" and label it "Allow selected photos only."

Class C — the app uses legacy file APIs.

Signs: EACCES plus an absolute path. Users cannot fix this; you need a build that uses Photo Picker or MediaStore. If that same package also demands all-files access or an accessibility service, walk away — the restricted settings guide and the autostart/background management guide cover the surrounding trade-offs. Similar URI-scope failures are documented in FileProvider and content:// sharing.

Class D — the grant looks fine but AppOps or device policy blocks it.

Signs: granted=true while appops get reports ignore. You can temporarily confirm with adb shell appops set <pkg> READ_MEDIA_IMAGES allow, but a reboot or policy refresh may revert it; check whether the device is managed under a work profile. See work profiles and pm user for that scenario.

---

8. When to just uninstall it

Keep tuning grants and you will waste an afternoon if any of these apply:

  • It declares WRITE_EXTERNAL_STORAGE and asks for all-files access, but it is just a wallpaper or utility app.
  • It simultaneously requests accessibility, notification access and device-admin, from a source you cannot trace.
  • With the photo permission turned off it still phones home or wakes the device repeatedly — check with the metrics in the 48-hour post-install audit.
  • You tried two or more "versions" and target-sdk plus the permission list are byte-for-byte identical — almost certainly the same repack batch.

At that point, go back to the full verification workflow and re-check the source. If the downloaded file itself is missing or you cannot find where it went, that is a different problem: downloaded file not found under scoped storage.

---

9. FAQ

Q1: Why does the same APK read photos fine on my old Android 11 phone but show nothing on Android 14?

Android 13 split READ_EXTERNAL_STORAGE into three granular permissions, and packages with targetSdk >= 33 no longer receive the compatibility mapping. The legacy permission works on the old OS and does nothing on the new one.

Q2: The permission dialog has three options — is the app asking for too much?

No. That is the Android 14 system dialog: "Select photos and videos / Allow all / Don't allow." Choosing the first puts the app into partial-access state, where it sees only the items you ticked.

Q3: Only my three newest screenshots appear. Will reinstalling fix it?

No. That is the READ_MEDIA_VISUAL_USER_SELECTED grant scope; reinstalling does not reset the user's choice. Change the scope using Class B in section 7.

Q4: I ran `adb shell pm grant` and the gallery is still empty. Why?

Two usual reasons: AppOps is set to ignore (step 5), or the app cached the empty result and needs am force-stop before reopening.

Q5: No permission dialog ever appeared — is it reading my library silently?

More likely it uses the system Photo Picker (PICK_IMAGES), which requests no permission and returns only the URI you selected. That is safer, not worse. Confirm the picker exists with step 8.

Q6: Can I force an old package to work with `pm grant READ_MEDIA_IMAGES`?

You can grant it, but if the app never calls requestPermissions() and reads raw paths directly, the grant changes nothing in its code path. A grant fixes system state, not application logic.

Q7: Do I need to grant `READ_MEDIA_AUDIO` together with the image permission?

No, the three are independent. For photos only, grant READ_MEDIA_IMAGES; add READ_MEDIA_VIDEO only if the app also reads video.

Q8: Are scoped storage and granular media permissions the same thing?

No. Scoped storage (Android 10/11) restricts *how* files are accessed; granular media permissions (Android 13+) restrict *whether* you may access a class of media. They stack, which is why old packages often hit both at once.

Q9: The log says `EACCES` but `dumpsys` shows `granted=true`. How?

The permission is present, but the app is opening a path it is not allowed to open directly — another app's private directory or a bare /sdcard/DCIM file handle. That is an API usage problem, not an authorization problem.

Q10: Can this be avoided before downloading at all?

Yes. Run apkanalyzer manifest target-sdk and manifest permissions on the APK before installing; it is far cheaper than diagnosing afterwards. The compatibility decision flowchart turns those two values into a one-minute yes/no check.

---

10. Further reading