No .entitlements file generated with widget extension

Hello,
my app use. iCloud with core data so for all my target. was generated automatically a .entitlements file. This file contains for exemple : my app group identifier.
When I added the new widget. extension many filles were created but no .entitlements file. So here when I try to access to the app group the app crash.
Is the fact .entitlements isn't generated with widget extension a bug ?
Answered by CedricLnx in 623264022
The .entitlements file, is generated at the root of the project directory and not in the target directory, that's why I didn't saw it.

Did you add the specific app group to your widget extension target? Xcode should automatically create an entitlement file once you add your first capability in the "Signing & Capabilities" section.

If that's not working, then please submit a Feedback.
I just tried and nothing was generated
Accepted Answer
The .entitlements file, is generated at the root of the project directory and not in the target directory, that's why I didn't saw it.

In my case, I duplicated the previous target. It is considering the previous targets .entitlements file for new one too and New entitlements file is not created automatically. Then i went to Build settings -> Signing -> Code signing entitlements and removed the filename.
It makes your target to clear some capabilities. I added the required capabilities again. As soon as i added the capabilities, new .entitlements file is created at the root level of my project.

I had the same issue, i logged and nothing appeared.

My solution : Enable a Capability

  • Open your project in Xcode and select your target.
  • Go to the "Signing & Capabilities" tab.
  • Click the "+" button to add a capability, such as "Background Modes" or "Push Notifications" (or anything)

And it will update capabilities and create file, then u can delete this new cap.

No .entitlements file generated with widget extension
 
 
Q