skip to content

Android App Links for your https ride links open the browser after release instead of the app; how do you find out why verification failed?

level: seniorimportance: should knowfreq 42%

answer

  1. ask the device for each domain's state
  2. autoVerify on a VIEW BROWSABLE filter
  3. a JSON file under .well-known
  4. which key really signs the app
  5. reset, re-verify, read again

basics

~20 s

Read each domain's state with adb shell pm get-app-links. Typical causes: no autoVerify filter with VIEW, BROWSABLE and DEFAULT, an unreachable or invalid assetlinks.json, or sha256_cert_fingerprints listing the upload key instead of Play's app signing key.

solid answer

~40 s

Start on a device with `adb shell pm get-app-links <package>`: each host shows `verified`, `none` (the verifier has not finished), `legacy_failure`, a verifier error code of 1024 or above, or `approved` / `denied` forced by a shell command. Then check the three inputs verification uses. The intent filter needs `android:autoVerify="true"`, `ACTION_VIEW`, the `BROWSABLE` and `DEFAULT` categories and an `http` or `https` scheme. Every host must serve a valid Digital Asset Links file at `https://<host>/.well-known/assetlinks.json`. Its `sha256_cert_fingerprints` must match the certificate that signed the installed APK, and with Play App Signing that is Google's app signing key from Play Console, not your upload key. After fixing, reset with `pm set-app-links --package <package> 0 all`, re-run with `pm verify-app-links --re-verify` (Android 12+), and test with `am start -a android.intent.action.VIEW`.

code

console · 10 lines
console
$ adb shell pm set-app-links --package com.example.ride 0 all
$ adb shell pm verify-app-links --re-verify com.example.ride
$ adb shell pm get-app-links com.example.ride
com.example.ride:
    ID: 01234567-89ab-cdef-0123-456789abcdef
    Signatures: [***]
    Domain verification state:
      ride.example.com: verified
      links.example.com: 1024
$ adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://ride.example.com/trip/42"

go deeper

for a junior

Recall the pieces: an autoVerify https intent filter in the app and an assetlinks.json file on the website that names the app and its signing certificate.

for a middle

Explain what the system fetches, from where, and what it compares, and why a filter needs VIEW, BROWSABLE and DEFAULT with an http or https scheme.

for a senior

Diagnose from evidence: per-domain states from pm get-app-links, the Play App Signing fingerprint trap, the reset and re-verify commands, and propagation delays by Android version.

for a principal

Own the release checklist: who updates assetlinks.json when signing keys or domains change, and how verification is checked before a release ships.

## What verification checks **Android App Links** are `http` and `https` links that open your app directly, with no disambiguation dialog, because the system has verified that your app and the website belong together. Verification starts when an app with at least one filter carrying `android:autoVerify="true"` is installed on Android 6.0 (API level 23) or higher. The system: 1. inspects every intent filter with the action `android.intent.action.VIEW`, the categories `android.intent.category.BROWSABLE` and `android.intent.category.DEFAULT`, and the scheme `http` or `https`; 2. for each unique host in those filters, fetches the **Digital Asset Links** file at `https://<host>/.well-known/assetlinks.json`; 3. checks that the file is valid and that its `sha256_cert_fingerprints` match the **signing certificate** of the installed app. If any of the three fails for a host, links to that host fall back to the browser or to a chooser. ## Read the state first On a test device with the release build installed, run `adb shell pm get-app-links <package>`. Each host shows one state: | State | Meaning | |---|---| | `verified` | the domain passed verification for this app | | `none` | nothing recorded yet; the verifier may still be working | | `approved`, `denied` | forced, usually by a shell command | | `migrated`, `restored` | carried over from legacy verification or a data restore | | `legacy_failure` | rejected by a legacy verifier, reason unknown | | `system_configured` | approved by the device configuration | | 1024 or higher | a verifier-specific error code | `adb shell pm get-app-links --user cur <package>` shows the state for the current user, including domains the user approved in settings. At run time, `DomainVerificationManager.getDomainVerificationUserState()` returns a per-host map whose values include `DOMAIN_STATE_VERIFIED`, `DOMAIN_STATE_SELECTED` and `DOMAIN_STATE_NONE`. ## The usual causes - **The filter.** `autoVerify` missing, `BROWSABLE` or `DEFAULT` missing, or the host written differently from the domain that serves the file. On Android 11 (API level 30) and lower, the app becomes the default handler only if **every** host in the manifest verifies, so one forgotten subdomain breaks them all. - **The file.** Not reachable at exactly that HTTPS path, invalid JSON, or the wrong package name. - **The key.** With **Play App Signing**, Google re-signs the app with the app signing key it holds, so a fingerprint copied from your local upload keystore does not match what users install. Copy the SHA-256 from Play Console's app signing key section; the fingerprint field is a list, so debug or upload fingerprints can sit beside it for test builds. - **The network.** The device must be online when verification runs. ## Re-run verification on a device From Android 12 you can re-run verification by hand, whatever the app targets: 1. `adb shell pm set-app-links --package <package> 0 all` resets the domains' state. 2. `adb shell pm verify-app-links --re-verify <package>` starts verification. 3. Wait a few minutes, then read the result with `adb shell pm get-app-links <package>`. 4. Test the link with `adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://<host>/trip/42"`. ## Timing after a fix Changing `assetlinks.json` does not reach phones at once: - **Android 15 (API level 35) and higher** re-verify domains periodically in the background; a change can take up to seven days to reach every device. - **Android 14 (API level 34) and lower** do not re-verify in the background; the file is usually read again only when the app is installed or updated. - Server-side caching can delay a new file even after a reinstall; retrying hours later usually clears it. ## Dynamic App Links on Android 15 From Android 15 (API level 35), on devices with Google services installed, the asset links file can also carry **dynamic rules** that refine which paths open the app, including exclusions, without an app update; the system picks them up when it re-fetches the file. These rules can only narrow what the manifest's intent filters declare, never widen it, and older Android versions ignore them and fall back to the manifest's filters. So a link that the manifest does not claim will never open the app, whatever the server says. ## When the user chose another app Only one app at a time can be associated with a domain on a device. If a link still opens elsewhere although your domain is `verified`, the user may have picked another app; you can send them to `Settings.ACTION_APP_OPEN_BY_DEFAULT_SETTINGS` to change it. Which screen a verified link should open, and the back stack it builds, is a navigation design question covered elsewhere.

  • Links verify on a sideloaded release build but not on copies installed from Google Play. What changed?
    The signing certificate. With Play App Signing, Google signs what users install with the app signing key it holds, while your local build is signed with the upload key. The `sha256_cert_fingerprints` in `assetlinks.json` must include the app signing key's SHA-256 from Play Console.
  • On an Android 11 device none of your three hosts open the app, though two are configured correctly. Why?
    On Android 11 (API 30) and lower, the app becomes the default handler for the manifest's URL patterns only when every host in it has a matching asset links file. One failing host makes the app lose all of them; on Android 12 and higher each domain's state is tracked separately.
  • You fixed assetlinks.json, but users on Android 15 still see the browser. Is the fix broken?
    Not necessarily. On Android 15 (API 35) and higher the system re-verifies domains periodically, and a change can take up to seven days to reach all devices; server caches can add delay. Confirm on a test device with `pm verify-app-links --re-verify` and wait for the background re-verification.

  • Adding autoVerify alone is enough; the website needs no file
  • The upload key's fingerprint is what Play-installed apps are signed with
  • A fixed assetlinks.json reaches every device as soon as it is deployed
  • pm get-app-links re-runs verification for the package
  • One failing host never affects the others, on every Android version

Assumes Android 17 (API 37); manual re-verification exists from Android 12, all-hosts-must-verify applies to Android 11 and lower, and background re-verification arrived in Android 15 (API 35).