assetlinks.json Explained: Verify Android App Links

assetlinks.json is the Digital Asset Links file that proves to Android that your app may open links on your website. Android fetches it from https://yourdomain.com/.well-known/assetlinks.json. If the file lists your app's package name and signing certificate fingerprint, links on that domain open straight in the app as verified Android App Links. If the file is missing or wrong, Android shows a chooser or opens the browser.

This guide covers what the file contains, where it must live, how to get the right SHA-256 fingerprint, the manifest change that triggers verification, and how to check verification with adb. If you already have a file and want to know whether it passes, paste your domain into the Android assets validator.

What is assetlinks.json?

assetlinks.json is a JSON file in the Digital Asset Links format, hosted on your website, that declares which Android apps are associated with the domain. Android App Links depend on it: when an app declares that it handles https links for a domain, Android downloads the domain's assetlinks.json and checks that the app's package name and signing certificate appear in it. Only then does the system treat the app as the verified handler for those links.

The file does the same job on Android that the apple-app-site-association (AASA) file does for iOS Universal Links. Both live under /.well-known/ on the domain, and both let the website, not the app alone, confirm the association. For the bigger picture of how the two platforms differ, see App Links vs Universal Links.

Where does assetlinks.json have to live?

assetlinks.json has to be served at exactly https://yourdomain.com/.well-known/assetlinks.json for every host your app's intent filters declare. Android checks each host separately, so example.com and www.example.com each need the file.

The file must meet these hosting rules:

  • HTTPS only: the file is fetched over https with a valid certificate.
  • No redirects: the URL must answer 200 directly. A redirect, even from http to https or to another path, makes verification fail.
  • JSON content type: serve it as application/json.
  • Publicly reachable: no login, no firewall rule or bot protection that blocks Google's fetchers.

If your links run on a short link domain managed in Smler, you still write the file, but you don't host it: you paste the full contents of your assetlinks.json into the deferred link settings for that domain, and Smler serves them at /.well-known/assetlinks.json with the application/json content type. A domain with nothing pasted returns a 404 for the file.

What does an assetlinks.json file contain?

An assetlinks.json file contains a JSON array of statements, and each statement names a relation and a target app. A file for one app looks like this:

Code
[
  {
    "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "com.example.app",
      "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"
      ]
    }
  }
]

Each field has one job:

FieldWhat it means
relationWhat the app is allowed to do. delegate_permission/common.handle_all_urls lets the app open the domain's links.
namespaceThe kind of target. For Android apps it is always android_app.
package_nameThe app's application ID, exactly as in its build file.
sha256_cert_fingerprintsThe SHA-256 fingerprints of the certificates that sign the app, in uppercase hex pairs separated by colons.

One file can list several apps, for example a production app and a beta app with different package names, as separate statements in the array. One statement can list several fingerprints, for example a release certificate and an upload or debug certificate.

How do you get the right SHA-256 fingerprint?

The SHA-256 fingerprint in assetlinks.json must match the certificate that signs the copy of the app installed on the device. Most verification failures come from listing the wrong one, so check which certificate signs each build.

Debug builds

Debug builds are signed with the local debug keystore. Print its fingerprint with:

Code
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

Release builds signed by you

If you sign release builds with your own keystore, print the fingerprint of that key:

Code
keytool -list -v -keystore my-release-key.keystore -alias my-key-alias

Apps that use Play App Signing

If the app is distributed through Google Play with Play App Signing, Google re-signs the app with its app signing key, so the certificate on users' devices is Google's, not your upload key. Copy the SHA-256 fingerprint of the app signing key from the app integrity section of Play Console. Add your upload key's fingerprint too if you install builds signed with it for testing.

What has to change in the Android manifest?

The app's manifest has to declare the links it handles in an intent filter marked android:autoVerify="true". That attribute is what makes Android fetch assetlinks.json and verify the domain:

Code
<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="https" android:host="example.com" />
</intent-filter>

Android verifies the hosts in the intent filter when the app is installed or updated. On Android 12 and later each host is verified on its own, so one failing host doesn't stop the others. On Android 11 and earlier, a failure on any declared host can stop verification for all of them, so every host in the filter needs a valid file.

You check App Link verification on a device running Android 12 or later with adb shell pm get-app-links, which prints each declared domain and its verification state:

Code
adb shell pm get-app-links com.example.app

A healthy result shows verified next to each domain. A domain stuck at none hasn't been verified yet, and other values point to a failed or manually set state. After fixing the file, ask the device to verify again:

Code
adb shell pm verify-app-links --re-verify com.example.app

To test from a clean state, reset the app's link state first, then re-verify:

Code
adb shell pm set-app-links --package com.example.app 0 all
adb shell pm verify-app-links --re-verify com.example.app

Finally, open a real link on the device and confirm it lands in the app, not in a chooser or the browser:

Code
adb shell am start -a android.intent.action.VIEW -d "https://example.com/offers"

For a full Android testing workflow, including Chrome and deferred deep link checks, see how to test deep links on Android. You can also open links on any device with the deep link tester.

What are the most common assetlinks.json errors?

The most common assetlinks.json errors are a wrong fingerprint, a file Android can't fetch cleanly, and a mismatch between the manifest and the file.

  • Upload key instead of the app signing key. Apps on Google Play with Play App Signing need Google's app signing fingerprint.
  • A redirect on the file URL. Serve the file directly at /.well-known/assetlinks.json on every host.
  • Wrong content type or invalid JSON. A trailing comma or an HTML error page instead of JSON fails verification.
  • Package name mismatch. The package_name must equal the application ID of the installed build, including any suffix a build variant adds.
  • A host missing from the file. Every host in the intent filter, including www, needs its own reachable file.
  • Missing autoVerify. Without it the links work only as unverified deep links that can show a chooser.

Google also offers a public statement list endpoint that shows what it reads from your domain:

Code
https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://example.com&relation=delegate_permission/common.handle_all_urls

The quickest check is the Android assets validator, which fetches your file and flags format and hosting problems in one step.

Smler handles assetlinks.json by hosting the file you write: you paste its full contents into the deferred link settings for your link domain, and Smler serves them at https://yourdomain/.well-known/assetlinks.json as application/json. Smler doesn't build the file from separate package name or fingerprint fields, so the package names and SHA-256 fingerprints in it are the ones you paste. Each domain holds one app configuration, and the pasted file can still list several statements, for example a production app and a beta app. The AASA file for iOS is pasted and served the same way, so links on that domain open your app as verified App Links on Android and Universal Links on iOS. Until you paste the contents, the file returns a 404. Smler supports https links only, not custom URI schemes. When the app isn't installed, the same link sends people to the Play Store and, with deferred deep linking, carries them to the right screen on first open. The setup steps are in the deep links docs, and the concepts behind them in what Android App Links are.

Frequently asked questions

Does assetlinks.json need a file extension?

Yes. Unlike the iOS AASA file, the Android file is named assetlinks.json, with the extension, at /.well-known/assetlinks.json.

Can one assetlinks.json file cover several apps?

Yes. Add one statement per app to the array, each with its own package name and fingerprints.

Do I need a separate file for www and the bare domain?

Yes. Android verifies each host in the intent filter separately, so each host must serve the file.

Why does my link still open a chooser after I uploaded the file?

Verification runs when the app is installed or updated. Re-run it with adb shell pm verify-app-links --re-verify, then check the state with adb shell pm get-app-links.

Do I have to host assetlinks.json myself if I use Smler?

No, but you still write it. Paste the full contents of your assetlinks.json into the deferred link settings for the domain, and Smler serves it at /.well-known/assetlinks.json with the application/json content type. You also add the intent filter with android:autoVerify="true" to your app.