This can easily be reproduced from scratch following these steps:
Launch Xcode and choose to create a new iOS app. Organization name: com.company, ProductName:experiments.
Therefore the bundle id is: com.company.experiments
Create a background download target, productName:backgroundDownloadExtension.
Therefore the bundle is is: com.company.experiments.backgroundDownloadExtension
When Xcode creates the extension it automatically gives it a group capability with id: group.com.company.experiements.
Within the signing & Capabilities section for the extension there is the following error:
Within the developer portal, go to the Identifiers section, locate the main app bundle com.company.experiements. If not ticked, tick the App Groups capability. Click on edit, select group.com.company.experiments
Within the developer portal Identifiers section, locate the extension bundle, com.company.experiments.backgroundDownloadExtension. Ensure the App Groups capability is ticked. Click on edit, select group.com.company.experiments.
Like so for both the app and extension:
Back in Xcode, for the app add the group capability, tick group.com.company.experiments. Now it matches the extension and will be like this for both of them:
Quit and relaunch Xcode because Xcode is so unbelievably sticky and seems to cache everything, e-v-e-r-y-t-h-i-n-g, and millions of problems can be solved just by quitting/relaunching it.
In the Signing & Capabilities section for the extension it still displays this:
Back in the developer portal, create a provisioning profile for iOS development, choose the com.company.experiments bundle id, download it.
Do likewise for the com.company.experiments.backgroundDownloadExtension
After downloading, click on them both.
Quit and re-lanch Xcode again. Any luck? No its still displaying the provisioning error.
Ok, enough of Xcode's automatic management of signing. Let's turn that off and import the the extension provisioning profile that was just downloaded. Still getting this error:
The entitlements file's contents are:
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.company.experiments</string>
</array>
The contents of the downloaded extension profile are:
<key>Entitlements</key>
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.company.experiments</string>
</array>
<key>application-identifier</key>
<string>MV8J9D3236.com.company.experiments.backgroundDownloadExtension</string>
<key>keychain-access-groups</key>
<array>
<string>MV8J9D3236.*</string>
<string>com.apple.token</string>
</array>
<key>get-task-allow</key>
<true/>
<key>com.apple.developer.team-identifier</key>
<string>MV8J9D3236</string>
</dict>
I give up, how the hell can you create a background download extension without Xcode displaying the error?