2

I'm currently using .xcconfig files to manage various build settings for an iOS app and generally it works great. I've found if I only modify the value(s) in the .xconfig files between builds then those changes do not get built into the app. I'm currently mapping the value in my info.plist from the macro value.

For example I have a variable like ENDPOINT_URL = someURL.com/v1. If later, the only change I make is making the modification ENDPOINT_URL = someURL.com/v2, the value is change in my project's build settings. In my info.plist I'm mapping the entry like so EndpointURL: ${ENDPOINT_URL} (not exact plist syntax but the general idea). But when reading it from my info.plist with [bundle objectForInfoDictionaryKey:@"EndpointURL"] it still has the value someURL.com/v1.

I've found that clean, delete derived data, restart Xcode generally works. But not always. And that isn't a great solution anyways.

Any thoughts on how to force Xcode to always use the value in my .xcconfig files? When creating the config files originally I saw an answer to add a build phase script that runs the touch command on my project's main.m to force a codesign on build, but it doesn't seem to work.

Thanks!

edit According to https://stackoverflow.com/a/41845248/962024 this looks like an issue that should have been addressed in Xcode 8.3 (which I'm currently using). Looks like it's time to file a radar.

Community
  • 1
  • 1
litebrite
  • 165
  • 1
  • 3
  • 11
  • where you able to fix it??? I have the same problem – Cesar Oyarzun Aug 03 '17 at 21:53
  • @CesarOyarzun unfortunately I haven't done anything fix this. I haven't seen this issue recently on my dev machine. Make sure you've updated XCode to the latest version. And if that doesn't work try restarting your computer. Sorry I don't have a better solution for you. – litebrite Aug 07 '17 at 17:16
  • I think by removing the derivedata will do the trick – Cesar Oyarzun Aug 07 '17 at 19:28
  • I'm having the same issue with 8.3.3 (8E3004b). Looks like 8.3 has broke it, not fixed it, because it worked seamlessly in previous versions. – hamstergene Sep 09 '17 at 15:23
  • This seems to started happening on Xcode 10.0 as well – Genki Sep 13 '18 at 19:49

0 Answers0