Xcode 8.3 (8E162) entitlements files variables always resolve against debug configuration
||Date Originated:||31-Mar-2017 17:20|
|Status:||Resolved (duplicate of 31456053)
||Product Version:||Xcode 8.3 (8E162)|
Starting with Xcode 8.3, entitlements files with variables that need to be resolved with a configuration's build settings, pulls the values of the variables from the Debug configuration instead of from the active configuration, resulting in the wrong values.
Steps to Reproduce:
1. Create a new iOS project
2. Add an entitlements file with the app groups entitlement
3. Edit the entitlements file to read $(SOME_VAR) to define the app group suite name
4. Define SOME_VAR in Xcode, but make it different between the Debug and Release configuration
5. Build the project from the command line with `xcodebuild -configuration Release`
`SOME_VAR` is referenced from the Release configuration
`SOME_VAR` is referenced from the Debug configuration
Xcode 8.3 (8E162)
- See the attached example project and logs for an example
- Build it with `xcodebuild -configuration Release` (you may have to change the bundle ID first
- Also see `releasebuildsettings.txt` which was generated via `xcodebuild -configuration Release -showBuildSettings`. This has the correct value for `SOME_VAR`
- See `output.log` to see the output from running the above command. As you can see, the incorrect value is substituted.
Sample project: https://github.com/keith/radars/tree/master/EntitlementsFileSubstitution
- Don't upgrade to Xcode 8.3
- Remove all configurations except the one you're trying to build before building. This can be scripted with [xcodeproj](https://github.com/CocoaPods/xcodeproj/)
- Duplicate your entitlements files across every config and don't use variables in them
- Pass the variables from the command line, instead of the build settings
Reports posted here will not necessarily be seen by Apple.
All problems should be submitted at bugreport.apple.com before they are posted here.
Please only post information for Radars that you have filed yourself, and please do
not include Apple confidential information in your posts. Thank you!