skip to Main Content

I’m trying to set up Xcode Cloud in my existing project. Everything builds and archives fine locally. However, Xcode Cloud builds fail. For some reason, random files here and there cannot be accessed. I had the issue with my fonts, but after solving this problem with an embedded SPM, I have the same issue with my Secrets file and my Localizable files. Those, I cannot embed in an embedded SPM. So I’m actually stuck.

Here are the build errors reported by Xcode Cloud:
The errors as reported by Xcode Cloud in Xcode, description of the errors below.

  1. /Volumes/workspace/Rheaparks/Shared/Resources/Secrets/Secrets.ison: No such file or directory
  2. Build input file cannot be found: ‘Volumes/workspace/Rheaparks/Rheaparks WatchKit App/Rheaparks-Watchkit-App-InfoPlist.strings’. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?

But as I said, everything works fine on my local copy of the repository, and when I look into Xcode, everything seems to be in order. I even tried to remove and add back the files, and clone the project onto another directory, to no effect.

Here are the file inspector’s details for the Secrets.json file:
Details about Secrets.json. Its location is Relative to Group, and the Full Path is matches the one in the error.

Did someone ever encounter this issue? How would you solve it?

Thank you in advance.

2

Answers


  1. Depending on the environment, language, and the use case, directories may have to be written out differently. For example in Windows c:Usersname may have to be written out with escape characters c:\Users\name depending on how the path is declared in the function. Try considering other ways to declare file paths, single quotes, double quote, escape slash, r (literal prefix), whatever may be appropriate for the language you’re writing your project in.

    I think a good place to start in regards to XCode-Cloud is to investigate this under the assumption that the shell itself generally behaves like one on MacOS.

    If this doesn’t get you anywhere, try this but from the perspective of working with directories on a Linux machine. I can’t find online what xcode-cloud servers use. But it wouldn’t hurt to try. Hope this made sense.

    Login or Signup to reply.
  2. You could add the Shared/Resources/Secrets directory as a folder reference, by selecting "Create folder references" instead of "Create groups" when adding the folder to the project. This will allow the project to build without Secrets.json. You then need to figure out another way to securely access your secrets when building in the cloud.

    Depending on the contents of Secrets.json, you could add its contents as environment variables in your workflow and access them that way. Or perhaps you could somehow populate Secrets.json in your ci_post_clone.sh.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search