I've had this issue for a while. Turning on "Associated Domains" in "Capabilities" allowed me to upload for TestFlight but with an empty associated domains array, which has the potential to get the app rejected during a review for the Store.
The only thing that worked for me was the following:
Turn ON associated domains in Capabilities, but leave it empty.
Find the entitlements.plist file for your app in the bundle, manually delete the entilement for associated domains. Don't turn off associated domains in capabilities.
Visit https://developer.apple.com/account/ios/identifiers/bundle/bundleList.action and click on App IDs, then your App ID and make sure "Associated Domains" is turned off.
Archive your project, and then the summary when validating/uploading shouldn't include the associated domain entitlement