Managed workflow
eas-cli v0.47.0
What does it mean if the XCode logs show that CODE_SIGN_ENTITLEMENTS is not set?
I am trying to get the onesignal-expo-plugin working, but ALMOST everytime I make a build with the plugin enabled, all my extra entitlements are cleared. I’ve opened an issue on the plugin’s repo here:
opened 03:56AM - 01 Mar 22 UTC
closed 07:12PM - 25 Mar 22 UTC
Help Wanted
Need More Information
iOS entitlements that were added manually through the Apple Developer portal app… ear to be erased during expo's `eas build` and replaced with one that's not useful.
I have Beta11 installed.
Here are the enabled capabilities for my app, taken from the Provisioning Profile that I manually generated in the Apple Dev portal:
![image](https://user-images.githubusercontent.com/66765028/156101430-77ed7f3b-73dc-486a-aa03-87f7c0292496.png)
Here are the entitlements in my XCode logs when running a build with and without OneSignal configured...
Without OneSignal:
```
{
"application-identifier" = "TEAM_ID.com.PROJECT.www";
"aps-environment" = production;
"beta-reports-active" = 1;
"com.apple.developer.applesignin" = (
Default
);
"com.apple.developer.team-identifier" = TEAM_ID;
"get-task-allow" = 0;
}
```
With OneSignal:
```
{
"application-identifier" = "TEAM_ID.com.PROJECT.www";
"beta-reports-active" = 1;
"com.apple.developer.team-identifier" = TEAM_ID;
"get-task-allow" = 0;
"keychain-access-groups" = (
"TEAM_ID.com.PROJECT.www"
);
}
```
As you can see, `aps-environment` and `applesignin` are both overwritten with `keychain-access-groups` when the OneSignal plugin is included in the build.
Here is my OneSignal plugin configuration in `app.config.ts`
```
plugins: [
'sentry-expo',
[
'onesignal-expo-plugin',
{
mode: process.env.NODE_ENV || 'production',
devTeam: 'TEAM_ID',
},
]
],
```
I've tried adding the entitlements manually to my `app.config.ts` like so:
```
ios: {
...,
entitlements: {
'aps-environment': 'production',
'com.apple.developer.applesignin': ['Default'],
'com.apple.security.application-groups': [
'group.com.yc14ec100daa.www.onesignal',
],
'keychain-access-groups': ['9T3ZC4D4BU.com.yc14ec100daa.www'],
},
}
```
And I was able to verify that the configuration was updated by running `expo config --type introspect`, but the entitlements were cleared again once I built using `eas build`
And here is the Apple email that brought the issue to my attention:
>Dear Developer,
We identified one or more issues with a recent delivery for your app, "PROJECT". Your delivery was successful, but you may wish to correct the following issues in your next delivery:
>ITMS-90078: Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the 'aps-environment' entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the 'aps-environment' entitlement. Xcode does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1.
>After you’ve corrected the issues, you can upload a new binary to App Store Connect.
Best regards,The App Store Team
I just finished getting my builds to complete without error by following the steps here: https://github.com/OneSignal/onesignal-expo-plugin/issues/40
I'm hoping I just messed up a step somewhere along the way.
Out of ~50 builds, I’ve managed to get my entitlements to make it through the eas build process only once, but I can’t seem to replicate the success.
I’m posting in this forum because I just discovered that in my XCode logs, CODE_SIGN_ENTITLEMENTS was set in the working build, but not in any others.
In the only working build I have:
CODE_SIGN_ENTITLEMENTS\=PROJECT/PROJECT.entitlements
But in the non-working builds, that line is skipped completely.
Hoping someone can shed light on what this means so that I can go about fixing the problem.