skip to Main Content

After upgrading from Xcode 12, on any version of Xcode 13 or later, the following error occurs when running the sudo sh install-appledoc.sh command:

Build input file cannot be found: '~/<ProjectDir>/appledoc/default_templates.zip'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'appledoc' from project 'appledoc')

After researching the issue, the best lead I could find was to make sure that the target does not have any excluded architectures, which it does not. I can also confirm the noted file does exist at the stated location. So I am stumped on this one. Any ideas on how to fix please?

2

Answers


  1. Chosen as BEST ANSWER

    This can be fixed by adding $(PROJECT_DIR)/default_templates.zip to the Output Files section of the Build Phases of the Appledoc project.


  2. adding $(PROJECT_DIR)/default_templates.zip to the Output Files section of the Build Phases of the Appledoc project.

    Well, yes: adding $(PROJECT_DIR)/default_templates.zip to the Output Files section in Xcode’s Build Phases explicitly instructs Xcode where to expect the file after the build scripts execute: Xcode now properly tracks the file during the build process, making sure that it is recognized at the specified location.

    That is mentioned in "Xcode / Build system / Running custom scripts during a build / Specify the input and output files for your script".

    By specifying the output file in the build settings, you effectively declare the dependencies of your build. Xcode can then make sure all listed files are generated as expected before it proceeds with subsequent build steps. That reduces the risk of errors related to missing files.

    As mentioned, avoid using sudo within your Xcode build scripts or when running scripts that integrate with Xcode. sudo can change the environment variables, which might be causing $HOME to point to the root home directory instead of your user’s directory.

    When using a pipeline, it is a good idea to add a script to echo $HOME or other relevant variables: a new Run Script Phase in Xcode:

    echo "Home directory: $HOME"
    echo "User: $(whoami)"
    

    That will print out the effective user and home directory path when the script is executed, which can help you debug path issues.

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