Background Asset. Failed because the app and extension do not share any application groups.

Hi everyone. We try to implement background assets to our project. And and encountered this problem.

When try to send background event from terminal

xcrun backgroundassets-debug --simulate --app-periodic-check -d [DEVICE_ID] -b [APP_BUNDLE_IDENTIFIER]

In console.app in device log we saw this type of logs

Text version :)

Resetting extension runtime for: [APP_BUNDLE_IDENTIFIER]
Application info for ([APP_BUNDLE_IDENTIFIER]) is being updated based on URL:(N/A)
Failed to find represented extension point. (ID:[APP_BUNDLE_IDENTIFIER]
Event (7) dropped for client ([APP_BUNDLE_IDENTIFIER]) failed because the app and extension do not share any application groups.

Tried on Xcode 15, iOS 17.0.2, MacOS 14

App Info.plist (in yml style)

---- part
<key>app-group</key>
<string>group.com.*******.MobileFWDemo</string>
<key>app-group-asset</key>
<string>group.com.*******.BackgroundAsset.Container</string>
<key>BAInitialDownloadRestrictions</key>
	<dict>
		<key>BADownloadAllowance</key>
		<integer>1610612736</integer>
		<key>BADownloadDomainAllowList</key>
		<array>
			<string>devstreaming-cdn.apple.com</string>
			<string>developer.apple.com</string>
			<string>http://example.com/</string>
			<string>https://www.learningcontainer.com/</string>
			<string>https://file-examples.com</string>
		</array>
		<key>BAEssentialDownloadAllowance</key>
		<integer>1073741824</integer>
	</dict>
	<key>BAManifestURL</key>
	<string>https://developer.apple.com/sample-code/background-assets/SessionsManifest.plist</string>
	<key>BAMaxInstallSize</key>
	<string>1610612736</string>
----- part

In BAExtension info.plist

<dict>
	<key>app-group</key>
	<string>group.com.*******.MobileFWDemo</string>
	<key>app-group-asset</key>
	<string>group.com.*******.BackgroundAsset.Container</string>
	<key>EXAppExtensionAttributes</key>
	<dict>
		<key>EXExtensionPointIdentifier</key>
		<string>com.apple.background-asset-downloader-extension</string>
		<key>EXPrincipalClass</key>
		<string>BackgroundDownloadHandler</string>
	</dict>
</dict>

App Entitlement

<dict>
	<key>aps-environment</key>
	<string>development</string>
	<key>com.apple.developer.applesignin</key>
	<array>
		<string>Default</string>
	</array>
	<key>com.apple.developer.associated-domains</key>
	<array>
		<string>applinks:******.onelink.me</string>
	</array>
	<key>com.apple.developer.game-center</key>
	<true/>
	<key>com.apple.security.application-groups</key>
	<array>
		<string>group.com.******.BackgroundAsset.Container</string>
		<string>group.com.******.MobileFWDemo</string>
	</array>
</dict>

Extension Entitlement

<dict>
	<key>com.apple.security.application-groups</key>
	<array>
		<string>group.com.*******.MobileFWDemo</string>
		<string>group.com.*******.BackgroundAsset.Container</string>
	</array>
</dict>

Method - not called

 - (NSSet<BADownload *> *)downloadsForRequest:(BAContentRequest)contentRequest
                                 manifestURL:(NSURL *)manifestURL
                               extensionInfo:(BAAppExtensionInfo *)extensionInfo

After add Background Asset Extension a new warning appeared in the logs:

Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (00000006:kIOGPUCommandBufferCallbackErrorBackgroundExecutionNotPermitted)

Maybe it wiil be connected to my problem.

Could someone help ?)

Did you add common app group between your main target and background asset target? Kindly check app common group exist in Targets -> <BackgroundAssetTarget> -> Signing & Capabilities and Targets -> <AppName (main Target)> -> Signing & Capabilities

Background Asset. Failed because the app and extension do not share any application groups.
 
 
Q