The desktop and phone apps are coming soon.

Join the waitlist

Why an Android app link shows the chooser instead of your app

An Android app link that asks which app to use, or opens the browser, has not been verified. What verification checks, and how to see why it failed.

By Mikkel Thygesen · Answers: Android app link shows chooser

A verified Android App Link opens your app directly. One that fails verification is an ordinary deep link: Android asks which app should open it, or on Android 12 and later hands it to the browser. Verification compares one file on your domain with your app's manifest and signing key, so the fix is almost always in one of those three.

The symptom

  • An ordinary deep link is subject to the system's disambiguation dialog, the chooser. A verified App Link opens your app without it (Android App Links).
  • From Android 12 (API level 31), a generic web intent goes to your app only if your app is approved for that domain; otherwise it goes to the user's default browser (Android 12 behaviour changes). On newer phones the same fault therefore shows up as the browser, not the chooser.
  • App Links need Android 6 or later on a device with Google services (About App Links).

The intent filter does not ask for verification

The intent filter needs android:autoVerify="true", the VIEW action, the DEFAULT and BROWSABLE categories, and <data> elements for both http and https with your host (Add App Links):

xml
<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="http" />
    <data android:scheme="https" />
    <data android:host="www.example.com" />
</intent-filter>
  • Google's own sample warns not to add other schemes to this filter: it prevents verification (Add App Links).
  • All <data> elements in one filter are merged, so a custom scheme belongs in a filter of its own (Add App Links).
  • On Android 11 and lower, the app becomes the default handler only if every host in the manifest verifies; on Android 12 and later each host is verified on its own (Verify App Links, Add App Links).

assetlinks.json is missing, redirected or the wrong type

Android fetches one file for each host (Configure assetlinks.json):

text
https://domain.name/.well-known/assetlinks.json
  • It must be served as application/json, over HTTPS whatever scheme your intent filter uses, and with no 301 or 302 redirect.
  • Each host needs its own file; subdomains count as separate hosts. A wildcard host such as *.example.com needs the file at example.com (Add App Links).
shell
curl -sI https://www.example.com/.well-known/assetlinks.json

The first line should be a 200, and content-type should say application/json. Both link files side by side, with Apple's tools for the other one: checking apple-app-site-association and assetlinks.json.

The fingerprint is not the one on the phone

The file names your package and the SHA-256 fingerprint of the certificate the app is signed with (Configure assetlinks.json):

json
[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.example",
    "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
  }
}]
  • package_name is the application ID from your build.gradle.
  • keytool -list -v -keystore my-release-key.keystore prints the fingerprint of your own key. With Play App Signing, that fingerprint usually does not match the one on users' devices: the right one, and a ready snippet, are in Play Console under Release, Setup, App signing (Configure assetlinks.json).
  • The field takes several fingerprints, for example a debug and a production build (Configure assetlinks.json).

Another build has the domain

Only one app at a time can be associated with a domain on a device. With a debug and a release build both installed, the one installed most recently takes the links (Add App Links, Verify App Links): uninstall the one you are not testing.

Verification has not run since you fixed it

  • Android verifies when the app is installed; Google suggests waiting at least 20 seconds (Verify App Links).
  • Android 15 and later re-verify in the background, and a change can take up to seven days to reach every device. Android 14 and lower typically pick up a change only when the app is installed or updated; uninstalling and reinstalling forces a new check, though Google warns that server-side caches can still hold back the new file (Verify App Links).
  • On Android 12 and later you can reset, re-run and read the result yourself (Verify App Links):
shell
adb shell pm set-app-links --package com.example 0 all
adb shell pm verify-app-links --re-verify com.example
adb shell pm get-app-links com.example

Each domain should say verified. none means verification might not have completed: wait a few minutes and run verify-app-links --re-verify again. legacy_failure, or a code of 1024 or more, means it failed (Verify App Links).

To open the link as a tap does, Google's test sends it with the BROWSABLE category a tapped link carries (Verify App Links):

shell
adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://www.example.com/"

Test it in Diver

  1. In the browser build at https://app.usediver.com, add the app and an environment with its link domain, Android package and every SHA-256 fingerprint the app is signed with, Play's included. Diver generates assetlinks.json from those fields; the admin console shows it to copy or download. Diver does not host it: your domain serves it, pasted in, or proxied from Diver with an API key so it stays in step with the environment (link files).
  2. In the desktop or phone app (coming soon), press Check on the environment. Diver fetches the file from your link domain and says whether it is Served and claims this app., and if not, why: the domain could not be reached, nothing is served, the file was redirected, it is not valid JSON, or it does not claim this app, with the package it misses or the fingerprint that is not listed. It does not read the content type, so keep the curl -sI above.
  3. From the desktop app on macOS or Windows, send the https link to an Android phone plugged in over USB. Diver hands it over with adb shell am start as an implicit VIEW intent, and you see on the phone which app takes it: the chooser, the browser or your app. Diver's send leaves out the BROWSABLE category, so on Android 12 and later confirm the result with Google's command above.

The phone and desktop apps are coming soon: tell me when they ship.

Sources