Xcode cloud: unable to open configuration settings file for secrets

367 Views Asked by At

I'm fairly new to Swift development and Xcode. I have Xcode Cloud connected to my GitHub PRs that ensures each commit I push can be archived.

I saw there were a few other similar questions of this error, but they were all Pods related, and I'm not using Pods.

I've recently moved all my API keys to a Git ignored configuration file. I followed this guide. This works locally, but when I push to GitHub, my Xcode Cloud checks fail with:

Config.xcconfig:1 unable to open configuration settings file

How can I fix this? I noticed that the Xcode Cloud has environment variables, so can I maybe use them?

1

There are 1 best solutions below

0
mikwat On

Here's how I solved this problem:

  1. Moved the contents of Config.xcconfig to LocalConfig.xcconfig
  2. Changed Config.xcconfig to include LocalConfig.xcconfig if it's found:
#include? "LocalSecrets.xcconfig"
  1. Added Config.xcconfig to source control
  2. Ensured LocalConfig.xcconfig ignored by source control

More details on the format of xcconfig files: https://help.apple.com/xcode/mac/11.4/#/dev745c5c974