iOS 14 Universal Links error

In iOS 14 have the error with Universal Links.

apple-app-site-association file:
Code Block json
{
applinks: {
apps: [ ],
details: [
{
appID: "*.*.*.app",
paths: [
"/a/welcome*",
"/a/reauthenticate*",
...
]
}
]
}
}


Error from swcutil_show.txt:
Code Block text
Service: applinks
App ID: *.*.*.app
App Version: 29.0
App PI: <LSPersistentIdentifier 0x15c85b7a0> { v = 0, t = 0x8, u = 0xa68, db = 18FE3197-81AC-479B-B616-5332AAB04064, {length = 8, bytes = 0x680a000000000000} }
Domain: app.com
User Approval: unspecified
Site/Fmwk Approval: unspecified
Flags:
Last Checked: 2020-12-08 21:46:07 +0000
Next Check: 2020-12-09 01:30:46 +0000
Error: Error Domain=SWCErrorDomain Code=7 "SWCERR00401 Bad JSON content -- {"cause":"invalid character '\u003c' looking for beginning of value"}" UserInfo={Line=274, Function=-[SWCDownloader URLSession:dataTask:didReceiveResponse:completionHandler:], NSDebugDescription=SWCERR00401 Bad JSON content -- {"cause":"invalid character '\u003c' looking for beginning of value"}, UnderlyingError=Error Domain=HTTP Code=404 "(null)" UserInfo={Line=274, Function=-[SWCDownloader URLSession:dataTask:didReceiveResponse:completionHandler:]}}
Retries: 1

Thanks!

Seeing the same issue start out of nowhere on our end as well. Previously, this worked fine and our configuration has not changed.

JSON is valid and tested by multiple validators.

testing in the Apple Validator Tools fails: https://search.developer.apple.com/appsearch-validation-tool

testing manually via curl also returns an error:
curl -v https://app-site-association.cdn-apple.com/a/v1/domain-name-here.com

Code Block language
< HTTP/1.1 404 Not Found
< Date: Thu, 10 Dec 2020 20:11:03 GMT
< Content-Length: 0
< Apple-Failure-Details: {"cause":"invalid character '\u003c' looking for beginning of value"}
< Apple-Failure-Reason: SWCERR00401 Bad JSON content


Question for you @Mike_Nedosekin, do you have the apple-app-site-association at the root, or in the .well-known dir?
Hi @mtsibulski. At the .well-known dir. Also check with root but get the same error.
Were you able to find a fix? I'm finding a similar issue and am not sure what the problem is at all. Sometimes my AASA file gets downloaded and sometimes it doesn't, and this \u003c error is one of the ones thrown. I think maybe it's parsing the headers as part of the JSON? When I curl the file it successfully downloads, but I have header content like in @mtsibulski's answer. \u003c is Unicode for "<", which is what shows up in the headers.

Also having issues now. Any solution here?

The AASA file format has changed for iOS 14, now you have to define a new json object called components which will support iOS 14 devices. Please include it in your AASA file and it should work then, your AASA file should look something like the following:

{
  "applinks": {
		"apps": [ ],
		"details": [
			{
				"appID": "*.*.*.app",
        "components": [
				  {"/": "/a/welcome*"},
				  {"/": "/a/reauthenticate*"},
				  ...
				],
				"paths": [
					"/a/welcome*",
					"/a/reauthenticate*",
					...
				]
			}
		]
	}
}

This is what is currently working in my production environment.

Also note from iOS 14 Universal Links will work in TestFlight builds only since apple introduced its own CDN and devices are no longer contacting your server directly. In case you want to test in development please consider using the new "alternate modes" to bypass Apple CDN altogether in development, take a look into this WWDC20 session What's new in Universal Links to get an overview on how to use the alternate developer mode.

I hope this will work for you as well!

P.S: I've referred to the exact "alternate modes" timing in the video, but I highly recommend watching the whole session

iOS 14 Universal Links error
 
 
Q