Short answer: If assetlinks.json cannot be parsed, Android has no statements for your domain and App Link verification fails. On Android 11 and lower that can stop every host in the app from verifying. Run the file through a JSON parser such as jq to find the line, fix it and re-verify with adb.
What is happening
Invalid assetlinks.json: a Digital Asset Links file that a JSON parser rejects, which leaves Android with an empty statement list for that host.
Google's statement list documentation says any response other than a 200 is treated as an error and results in an empty statement list. A file that cannot be parsed has the same outcome: no statement links the site to your app.
- Links open in the browser instead of the app.
adb shell pm get-app-linksshows a state other thanverified.- On Android 11 and lower, Google says "verification fails if even one host cannot be verified", so one broken file can affect all hosts.
Why does this happen?
The file is usually hand-edited or assembled from a snippet. JSON rejects trailing commas, comments, single quotes and curly quotes.
- Trailing comma after the last fingerprint or the last statement.
- Two snippets pasted together without merging them into one array.
- Smart quotes from a document or chat tool.
- HTML instead of JSON returned by a framework route or error page.
How to confirm it
- Fetch the file:
curl -i https://example.com/.well-known/assetlinks.json. Check for a 200,Content-Type: application/jsonand a body starting with[. - Run the body through a JSON parser, for example
curl -s https://example.com/.well-known/assetlinks.json | jq ., which reports the line and column of any syntax error. Google's Statement List tester also reports a file it cannot read. - Ask Google's Digital Asset Links API what it can read:
https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://example.com&relation=delegate_permission/common.handle_all_urls. An empty list means no usable statements. - On a device, run
adb shell pm get-app-links com.example.appand check the domain state.
How to fix it
- Correct the syntax error and validate again.
- If you merged several snippets, make sure the result is one array of statement objects.
- Serve the file at
https://example.com/.well-known/assetlinks.jsonwith a 200, no redirect andapplication/json. - Re-run verification on Android 12 and later:
adb shell pm set-app-links --package com.example.app 0 alladb shell pm verify-app-links --re-verify com.example.app- wait a few minutes, then
adb shell pm get-app-links com.example.app
[{
"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"]
}
}]
The Android App Links setup guide has a valid example to start from. Next, check the fingerprint, which is the most common problem once the JSON parses.