Hello,
My project fails to build/run on a physical device or archive, due to a persistent provisioning error.
Exact Error: Provisioning profile "iOS Team Provisioning Profile: com.huiwan.Ohra-Journal" doesn't include the BGTaskSchedulerPermittedIdentifiers entitlement.
I have already performed extensive troubleshooting, and all local configurations appear to be correct:
Capabilities: "Background Modes" with the "Background processing" option is enabled in the target's "Signing & Capabilities" tab. Info.plist: The Permitted background task scheduler identifiers key is present in the target's Info.plist, and it contains the correct task identifier (com.huiwan.ohra-journal.refresh). Entitlements File: The .entitlements file is correctly configured by Xcode. Full Reset: I have tried a complete reset procedure, including deleting ~/Library/Developer/Xcode/DerivedData and ~/Library/MobileDevice/Provisioning Profiles/, restarting Xcode, and letting the automatic signing system regenerate the profile from scratch. The issue persists.
Despite all these correct local settings, the provisioning profile automatically generated by Xcode is consistently missing the required entitlement. This strongly suggests a server-side issue with the provisioning service for my App ID (com.huiwan.Ohra-Journal).
I filed a bug report on the Feedback Assistant (FB20268285) a week ago but have not received a response. This issue is completely blocking my development and ability to submit the app.
Could you please investigate the status of my App ID and the provisioning services associated with it?
Thank you.
Exact Error: Provisioning profile "iOS Team Provisioning Profile: com.huiwan.Ohra-Journal" doesn't include the BGTaskSchedulerPermittedIdentifiers entitlement.
So, the issue here is that the way Xcode describes codesign error is with the assumption that your local configuration (meaning, your Entitlement plist) is correct and the provisioning profile is "wrong", so you need to "add" something to your profile.
In this case, the solution is the reverse of that— instead of modifying your profile, what you actually need to do is delete "BGTaskSchedulerPermittedIdentifiers" from your entitlement plist.
Expanding on that point here:
Despite all these correct local settings, the provisioning profile automatically generated by Xcode is consistently missing the required entitlement.
Nothing in the BackgroundTask framework requires any entitlement. The only configuration required is the Info.plist configuration.
Finally, on this point:
Despite all these correct local settings, the provisioning profile automatically generated by Xcode is consistently missing the required entitlement.
Automatic codesign-ing in Xcode has reached the point that it works properly for the vast majority of use cases*. You shouldn't need to manually modify your Entitlement.plist, and doing so is exactly what creates this kind of problem.
*I say this as the DTS Engineer who supports DriverKit, the one technology entitlement set which Xcode definitely does NOT support properly.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware