Sideloaded APK Can't Detect or Launch Other Apps: Android 11 Package Visibility and queries, Diagnosed Step by Step
The app installs, opens and renders its home screen, but 'Open with Maps', 'Share to WhatsApp' or 'Pay with banking app' does nothing, and the chooser is empty - even though adb shell pm list packages clearly shows those apps. This is rarely a broken build. Since Android 11 (API 30), PackageManager filters results by caller identity: apps with targetSdk >= 30 see only a limited set unless they declare queries or hold QUERY_ALL_PACKAGES. A full mechanism table, runnable aapt / adb / curl commands, a nine-step diagnostic path, an error and status reference, version differences, an FAQ, and verified internal links.
There is a class of failure that makes people assume they downloaded a crippled build. The APK installs, the icon is there, the home feed loads - but tap "Open with Maps", "Share to WhatsApp", "Scan with camera" or "Continue to payment" and nothing happens, or the chooser that appears is empty. The confusing part: plug the phone into a computer and run adb shell pm list packages, and WhatsApp, Maps and the banking app are all listed. The app itself, however, insists they are "not installed" or returns an empty list.
So people uninstall and reinstall, clear data, switch download sources, hunt for a "full" or "unlocked" edition. Almost none of that touches the cause. If the system can list those packages, they are installed and registered. The app cannot see them because, starting with Android 11 (API 30), PackageManager filters results by the identity of the caller. The same query returns the full set to the system service and only an allowed subset to your app.
This is not a bug. It is a deliberate privacy hardening that stops apps from silently enumerating everything a user has installed. Apps distributed through the store and maintained under current rules handle it without incident, but two kinds of sideloaded builds get hit repeatedly: old apps frozen at targetSdk 29 or lower, and - more often - apps that raised targetSdk to 30+ without adding a `queries` declaration to the manifest. The result is especially misleading when one APK works perfectly on an Android 10 phone and then "loses its share list" on Android 12, 13 or 14, which gets misdiagnosed as a compatibility problem.
This article takes the chain apart: four distinct failure shapes, a mechanism table that identifies which layer is filtering, copy-paste aapt / adb / curl commands, a nine-step diagnostic path, an error and status reference, version differences, an FAQ and verified internal links. Two actions do most of the work: read the package's targetSdkVersion, and replay the app's intent resolution with `cmd package query-activities`.
1. Separate the four kinds of "won't launch" before you reinstall anything
Package visibility problems look different on the surface, but the root cause lands in one of four buckets. Matching your symptom first saves a lot of pointless work:
- Empty or incomplete chooser. Tap "Share" or "Open with" and the list holds one or two apps, or is blank. This is
queryIntentActivities()returning an empty or truncated set - the most direct signature of visibility filtering. - Explicit "not installed / app not found". The app proactively checks for a package name ("Please install WhatsApp first"),
getPackageInfo()throwsNameNotFoundException, and the code takes its error branch. The package is there; it is just outside the visible set. - Crash or silent failure on tap. The app fires an implicit intent with no null check,
startActivity()throws an uncaughtActivityNotFoundException, and it crashes; or the exception is swallowed and the tap simply does nothing. - One specific capability fails while the main flow is fine. The app opens and login works, but "View terms in browser" goes blank, "Launch camera" fails, or a ContentProvider query returns null. These are the narrow cases where an intent signature or provider authority was never declared in
queries.
Two distractors to rule out immediately: the target app is installed in another user space (Work Profile, Second Space, Private Space, Secure Folder), in which case the main-space app genuinely cannot see it and the problem is multi-user isolation, not visibility; and the target app is disabled or is an uninstall leftover, which only shows up with pm list packages -u. Both have dedicated adb checks in the step-by-step path below.
2. Mechanism table: exactly where the filtering happens
Package visibility is not a single switch but a set of rules layered by targetSdk, declaration type and query type. Use the "symptom" column against your logs.
| Layer / trigger | System behaviour | What the app sees | Typical symptom |
|---|---|---|---|
| targetSdk <= 29 on Android 11+ | Legacy permissive visibility retained | Can enumerate nearly all packages | Old apps "work", newer ones fail |
| targetSdk >= 30, no queries in manifest | Only itself, system components, a few default handlers visible | queryIntentActivities() heavily reduced | Empty or thin share/chooser list |
<queries><package android:name="..." /> declared | That one package joins the visible set | The named package resolves | Named partner app works, others don't |
<queries><intent> signature declared | Components matching that intent resolve | Matching handlers listed | "Open with browser/maps" recovers |
<queries><provider android:authorities="..." /> declared | That authority is visible | ContentProvider no longer returns null | Cross-app data reads recover |
QUERY_ALL_PACKAGES requested | No filtering applied | Full enumeration | Needed by stores/cleaners; Play policy restricts it |
| System auto-visible allowlist | Visible with no declaration | Itself, installer, default browser, etc. | A few capabilities "happen to work" |
pm list packages from adb shell | shell UID is not filtered | Full output | Source of the "computer sees it, app doesn't" illusion |
| Target package belongs to another UserHandle | Per-user isolation | Not queryable from main space | Needs --user or pm list users |
| Target package disabled / uninstall leftover | State is not ACTIVE | Skipped during resolution | pm list packages -d / -u reveals it |
| Implicit intent with no matching handler | Resolution returns empty | ActivityNotFoundException | Crash or silent no-op on tap |
| App Links domain unverified | Default browser takes over | Target app absent from candidates | Requires assetlinks.json validation |
| OEM customisation (some Chinese ROMs) | Extra "read app list" restriction | Still blocked despite declaration | Separate toggle in Settings |
The most misunderstood point: every pm / cmd package subcommand inside adb shell runs as the shell UID and is not subject to package visibility filtering. So "adb lists it, the app doesn't" is not a contradiction - it is the confirming signal. To reproduce the app's view you must either use cmd package query-activities with an explicit user, or fire a real resolution with am start from the shell (section 4).
3. targetSdk is the master switch
Why does one APK behave fine on an old phone and break on a new one? Because the enabling condition is the calling app's targetSdkVersion, not simply the OS version.
- targetSdk <= 29: the system keeps the old "see everything installed" behaviour for compatibility. Many sideloaded builds abandoned around 2019 fall here, which is why they do *not* trigger this problem even on Android 14.
- targetSdk >= 30: filtering is on by default. The developer must add
<queries>toAndroidManifest.xmlnaming exactly who it needs to see, or requestQUERY_ALL_PACKAGES. - The critical detail: raising targetSdk without adding queries silently degrades functionality. That is the dominant cause of "new sideloaded build can't launch other apps", and it produces no install-time error at all - installation succeeds, launch succeeds, and the defect only surfaces on a cross-app call.
There is a second, compounding layer: Android 12 requires explicit android:exported, Android 13 adds the notification runtime permission, and Android 14 tightens foreground-service and exact-alarm policy. These are independent of package visibility but all present as "some feature stopped working after install". If queries is already declared and the failure persists, walk the version table in section 7 instead of circling back to package integrity.
4. Runnable command list
All commands below run from a computer over adb, or directly against the APK file; none require root. Replace <pkg> with the misbehaving app's package name (e.g. com.example.app) and <apk> with a local file path.
# 1. Confirm the device and get the exact package name
adb devices
adb shell pm list packages | grep -i example
adb shell pm path com.example.app
# 2. The single most important step: read targetSdkVersion
aapt dump badging app.apk | grep -E "package:|sdkVersion:|targetSdkVersion:"
# Without aapt, use apkanalyzer (Android SDK cmdline-tools)
apkanalyzer manifest application-id app.apk
apkanalyzer manifest target-sdk app.apk
# 3. Dump the queries declaration straight out of the binary manifest
aapt dump xmltree app.apk AndroidManifest.xml | grep -i -A6 -B2 "queries\|package\|intent\|provider"
# Or print the merged manifest
apkanalyzer manifest print app.apk | grep -i -A10 "queries"
# 4. Replay intent resolution from the app's point of view (core repro)
adb shell cmd package query-activities --brief -a android.intent.action.VIEW -d "https://www.example.com/page"
adb shell cmd package query-activities --brief -a android.intent.action.SEND -t "text/plain"
adb shell cmd package resolve-activity --brief -a android.intent.action.VIEW -d "https://www.example.com/page"
# 5. Inspect what visibility the app was actually granted
adb shell dumpsys package com.example.app | grep -i -A20 "queries\|QUERY_ALL_PACKAGES\|visibility"
adb shell appops get com.example.app QUERY_ALL_PACKAGES 2>/dev/null || true
# 6. Rule out multi-user / disabled / leftover "false invisibility"
adb shell pm list users
adb shell pm list packages --user 0 | grep -i whatsapp
adb shell pm list packages -d # disabled packages
adb shell pm list packages -u # includes uninstall leftovers
adb shell cmd package dump com.example.app | grep -i "userId\|enabled"
# 7. Capture the resolution failure and its exception type
adb logcat -c && adb logcat -s PackageManager ActivityManager AndroidRuntime | grep -i -E "not found|ActivityNotFound|NameNotFound|query|visibility"
# 8. Fire a real start to see whether ActivityNotFoundException is thrown
adb shell am start -a android.intent.action.VIEW -d "https://www.example.com/page"
# 9. App Links domain verification (if link ownership, not visibility, is suspect)
adb shell pm get-app-links com.example.app
curl -sSI "https://www.example.com/.well-known/assetlinks.json" | head -20
# 10. Compare the same intent on a device with a different targetSdk build
adb shell cmd package query-activities --brief --user 0 -a android.intent.action.SENDTO -d "smsto:10086"Usage notes. query-activities accepts -a (action), -d (data URI), -t (MIME type) and -c (category), combinable; --brief keeps only component names for easy comparison. In step 3, aapt dump xmltree is unreliable for the <queries> node on some newer SDK builds, so apkanalyzer manifest print is the safer fallback. The curl in step 9 checks from the PC side that assetlinks.json returns 200 with the right fingerprint - because "the target app is missing from the chooser" is sometimes not visibility at all but failed App Links verification.
5. Nine-step diagnostic path
Work in order and stop as soon as one step identifies the cause.
- Classify the symptom using the four buckets above: empty list, "not installed", crash, or one capability failing. If it is "app installed in another user space", jump to step 8.
- Read targetSdkVersion with
aapt dump badgingorapkanalyzer. <= 29 largely rules out visibility as the primary cause - move to signing, ABI and exported components; >= 30 continue. - Dump the manifest's queries to see whether anything is declared, and whether it is package names, intent signatures or provider authorities. No
<queries>at all and noQUERY_ALL_PACKAGESis close to a diagnosis. - Reproduce with query-activities: replay the exact intent the app fires and count the candidates returned. Empty = resolution-layer problem; several returned but only one displayed = app-side filtering logic.
- Read the exception type in the log:
NameNotFoundExceptionmeans an explicit package lookup,ActivityNotFoundExceptionmeans a direct implicit-intent start,SecurityExceptionmeans permissions/exported components. Each has a different fix. - Check the target app's state: compare
pm list packages --user 0,-dand-uto confirm the target is enabled and in the current user space. - Check App Links and default roles:
pm get-app-linksfor domain verification; for link-based launches alsocmd role holders android.app.role.BROWSER. - Rule out multi-user isolation: if
pm list usersshows a second user or Work Profile, replay the query with--user <id>to determine whether the app was installed into the wrong space. - Do a version comparison: run the same APK on two devices with different Android versions (or different targetSdk builds) to confirm the problem tracks the OS level; then decide between switching to an adapted build and allowing the OEM "read app list" toggle in Settings.
6. Error and status reference
| Symptom / log keyword | Layer | Meaning | Next step |
|---|---|---|---|
NameNotFoundException | Explicit package lookup | Target outside visible set, or genuinely absent | Steps 3, 6 |
ActivityNotFoundException | Intent resolution | No matching handler, or uncaught exception | Steps 4, 5 |
queryIntentActivities size=0 | Visibility filtering | queries missing or signature mismatch | Steps 3, 4 |
SecurityException: ... exported | Exported component | No explicit exported on Android 12+ | Check target app manifest |
Permission denied / appops refusal | OEM permission | Extra "read app list" restriction | Allow it in Settings |
pm list packages shows it, app can't find it | Normal filtering | shell UID vs app UID viewpoint | Reproduce with query-activities |
QUERY_ALL_PACKAGES present in manifest | Permission declared | System stops filtering (Play restricts it) | Check whether ROM blocks it |
assetlinks.json 404 / fingerprint mismatch | App Links | Domain verification failed, browser takes over | curl check in step 9 |
| Reproduces only on Android 11+ | Version gate | targetSdk >= 30 enables filtering | Section 7 comparison |
| Older APK build works | Build difference | New build dropped the queries declaration | Switch to adapted build or report upstream |
7. Version differences
| Android version | Relevant change | Practical effect on sideloaded builds |
|---|---|---|
| Android 10 (API 29) and below | No filtering; full enumeration | Baseline for old-app behaviour |
| Android 11 (API 30) | Package visibility introduced; targetSdk >= 30 filtered by default; <queries> and QUERY_ALL_PACKAGES added | The watershed where the problem starts |
| Android 12 (API 31) | android:exported mandatory; components with intent-filters fail to install without it | Overlaps with visibility, easy to confuse |
| Android 13 (API 33) | Notification runtime permission; finer component visibility policy | "No notifications" and "can't launch" occur together |
| Android 14 (API 34) | Install blocking for targetSdk < 23; stricter foreground-service limits | Old builds may not install at all |
| Android 15 / 16 | Same filtering model; tighter Play review of QUERY_ALL_PACKAGES | Sideloaded builds depend more on precise queries |
8. FAQ
Q1: Does reinstalling the APK help?
No. Visibility is determined by the manifest declaration and system policy. Reinstalling changes neither, and does not reset the system's filtering rules for the caller.
Q2: Will clearing app data or cache fix it?
No. Filtering happens in the PackageManager query layer and is evaluated on every call; local cache is irrelevant.
Q3: Why can adb see the package but the app cannot?
adb shell runs as the shell UID and is exempt from package visibility filtering; the app runs as its own UID and sees the filtered subset. That difference is itself a diagnostic clue.
Q4: Does granting a "read app list" permission help?
On some Chinese OEM ROMs, yes - they add an extra restriction on top and you must allow it separately in Settings. On stock Android, no ordinary permission bypasses visibility filtering; the app itself must declare queries.
Q5: Is downgrading to an older APK the easiest workaround?
If the older build has targetSdk <= 29 and still does what you need, it does bypass filtering and is a valid short-term option. But old targetSdk faces install blocking on Android 14+ and growing compatibility risk, so the durable answer is a newer build adapted with queries.
Q6: Can I add `QUERY_ALL_PACKAGES` myself?
The manifest lives inside the APK; modifying it changes the signature, counts as repackaging, breaks signature consistency with the original and may introduce security risk. It is not something an end user should do - and it is a good reason to avoid "unlocked" builds from unknown sources.
Q7: How do I tell package visibility from App Links verification failure?
Both show up as the target app missing from the chooser. Check pm get-app-links <pkg> for domain verification state and use curl against /.well-known/assetlinks.json. If the domain is verified, go back to the queries declaration.
Q8: The share list is missing only one or two apps - is that the same problem?
Yes, and it is the most typical presentation. The system lists only handlers that match the intent *and* are visible to the caller; whichever app is missing usually corresponds to the intent signature the manifest forgot to declare.
Q9: If the target app is in a Work Profile, can the main-space app see it?
No - that is multi-user isolation, not package visibility. pm list users will show more than one UserHandle, pm install targets only the current user by default, and you need --user to address the other one. The diagnostic chain is entirely different.
Q10: When should I conclude the APK itself is broken and stop this path?
When aapt dump badging cannot read targetSdk, manifest parsing reports INSTALL_PARSE_FAILED, or logs consistently show Signature mismatch / native UnsatisfiedLinkError. At that point the problem has left this chain and belongs to package integrity, signing and ABI.
9. Further reading
These in-site articles sit adjacent to this diagnostic chain:
- App links still open in the browser after sideloading: domain verification and link ownership
- Sideloaded app won't become the default: default-role qualification and intent-filters
- Blank in-app WebView after sideloading: embedded WebView vs external launches
- APK won't install in a Work Profile: multi-user isolation and pm install --user
- No app icon after install: exported components and launcher entry points
- App crashes on launch: using logcat to separate crash from resolution failure
- Downloaded APK file not found: file visibility under scoped storage
- targetSdkVersion explained: why it gates so many policies
- Android 14/15 sideloading changes: install blocking for old targetSdk
- APK install failed error codes: rule out install-time errors first
- APK notifications not showing: another common "feature missing after install" cause
- XAPK / APKS / APKM install guide: missing capabilities when only base.apk is installed
Bottom line
"Installed but can't launch other apps" is not a crippled build - it is PackageManager filtering by caller identity since Android 11, triggered when the app's own targetSdk >= 30 and the manifest lacks a queries declaration. Two actions do the heavy lifting: read targetSdkVersion with `aapt dump badging`, and replay the app's intent with `cmd package query-activities --brief`. The first tells you whether filtering is active; the second tells you what resolution actually returned. Once the manifest is confirmed as the cause, stop reinstalling on the phone - either switch to a build the developer adapted, or accept that this build has a hard capability boundary.