Short answer: Valid JSON is not enough. iOS expects a top-level object with an applinks key, a details array inside it, and each entry holding appIDs and components. If keys are misnamed, nested wrongly or mixed with the legacy format, iOS finds no rules. Check it with sudo swcutil verify on a Mac.
What is happening
AASA structure error: an apple-app-site-association file that parses as JSON but does not follow the applinks > details > appIDs and components layout that Apple documents.
Apple's applinks object has three keys: defaults, details and substitutionVariables. Only details is needed for basic universal links. Each details entry pairs the apps with the URL patterns they handle.
- A top-level array (
[...]) instead of an object is the most obvious version of this error. appIdorAppIDsinstead ofappIDssilently fails, because keys are case-sensitive.componentsplaced outside adetailsentry is ignored.
Why does this happen?
Most structure errors come from copying an old tutorial or mixing the two formats Apple has used. The legacy format used appID (a string) and paths; the current one uses appIDs (an array) and components.
- Apple says: "Please avoid mixing formats. Doing so may result in unexpected behavior."
- Older guides and forum threads describe an empty
"apps": []key insideapplinksfor the iOS 9 to 12 format. Current Apple documentation does not mention it, so treat it as legacy. webcredentialsandappclipsuse anappsarray, notdetails. Apple notes that "the details dictionary only applies to the applinks service type".
How to confirm it
- Fetch the file:
curl -s https://example.com/.well-known/apple-app-site-association. - Check the first character is
{and the top-level keys includeapplinks. - Compare it with the example in the universal links setup guide: a top-level object, a non-empty
detailsarray, and entries with bothappIDsandcomponents. Then runsudo swcutil verifyagainst a real URL. - On a Mac, test a URL with
sudo swcutil verify -d example.com -j apple-app-site-association -u https://example.com/buy/1. A good file printsPattern "..." matched.
How to fix it
- Make the top level an object.
- Add
applinkswith adetailsarray. - In each entry, use
appIDs(array of strings) andcomponents(array of objects). - Remove any
appIDandpathskeys from entries that usecomponents, so formats are not mixed. - Keep
webcredentialsandappclipsas separate top-level keys withappsarrays. - Deploy and reinstall the app on a test device.
The structure from Apple's own example:
{
"applinks": {
"details": [
{
"appIDs": ["ABCDE12345.com.example.app"],
"components": [
{ "#": "no_universal_links", "exclude": true },
{ "/": "/buy/*" },
{ "/": "/help/*", "?": { "articleNumber": "????" } }
]
}
]
},
"webcredentials": { "apps": ["ABCDE12345.com.example.app"] }
}
If the file has no applinks key at all, see no applinks section. The universal links setup guide walks through the structure.