Xcode 14.1 is unable to provision an asset download extension

This can easily be reproduced from scratch following these steps:

  1. Launch Xcode and choose to create a new iOS app. Organization name: com.company, ProductName:experiments.

Therefore the bundle id is: com.company.experiments

  1. 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:

  1. 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

  2. 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:

  1. 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:

  2. 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:

  1. Back in the developer portal, create a provisioning profile for iOS development, choose the com.company.experiments bundle id, download it.

  2. Do likewise for the com.company.experiments.backgroundDownloadExtension

  3. After downloading, click on them both.

  4. Quit and re-lanch Xcode again. Any luck? No its still displaying the provisioning error.

  5. 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?

I found out what the problem is - which I believe must be a bug in Xcode in how it creates the extension target.

If different types of extension are created (for example an action extension or a call extension) then if you look at the Code Signing Entitlements section within Build Settings its empty. However, if a background asset download extension is created then it's not empty. If its changed to be empty then the problems described above go away.

Still seems like it's a problem in Xcode 14.2

Try ensuring that this key/value is in both the app and extension's entitlement's file.

<key>com.apple.developer.team-identifier</key>
<string>MV8J9D3236</string>

If all else fails, grab a sysdiagnose and use Feedback Assistant.

Xcode 14.1 is unable to provision an asset download extension
 
 
Q