Xcode 15 build error Info.plist "error: Build input file cannot be found:..."

I've been trying to add an 'Info.plist' file this afternoon and get a recurring error that I haven't seen before. I see a lot of other people have posted similar errors over the time but I con't seen any solutions posted. I'd appreciate anyone reading this giving it a boost to perhaps have an engineer post a solution so others will not waste as much time on this as I have.

. Info.plist has the proper path, I do not have a 'script phase' or 'custom build rule', and I don't know what "Did you forget to declare this file as an output of a script phase or custom build rule" means. I've had Info.plists before, I'm just not sure why I'm getting this error or how to bypass it.

Answered by DTS Engineer in 793758022

If you encounter an error in Xcode stating, “Build file cannot be found: info.plist, did you forget to declare this file?”, but the file is indeed present in the project. It seems like you may have moved the file but did not tell Xcode you did. Can you provide the screenshot of “Target” -> “Info” to see what it looks like? I see you navigate to it, but I think it got moved; you can just go to “Settings” -> “Target”, and in the “Info” tab, it will show you the file or let you reference one there. Below a few other things to check. However, you can move it back to the root of the project instead of “SupportingFiles”.

Here are some steps you can take to troubleshoot and resolve the issue:

  1. Verify File Location: Double-check the file path and ensure that "info.plist" file is correctly placed within the project's root directory or the appropriate group.

  2. Check Target Membership:

    • Select your project file in Xcode.
    • Navigate to the "Targets" section.
    • Make sure the "info.plist" file is included in the target membership for the build configuration where you're encountering the error.
  3. Validate File Type: Ensure that the "info.plist" file is correctly set as a "Property List" file in Xcode. You can verify this by right-clicking the file, selecting "Get Info," and confirming that the "Type" is set to "Property List."

  4. Clean and Build Project: Perform a "Clean" action first (Shift + Command + K), and then try building the project again (Command + B). This can help resolve any potential build cache or metadata issues.

  5. Delete Derived Data: Sometimes, Xcode's derived data can get corrupted and cause such errors. To delete derived data, navigate to "File" > "Clean Build Folder" > "Delete Derived Data."

  6. Check for Spelling or Naming Errors: Double-check the filename and ensure there are no spelling or naming mistakes. Even a small difference can lead to this problem.

  7. Validate Info.Plist Contents: Open the "info.plist" file in a text editor and ensure that it's a valid XML file. There might be some syntax errors causing the issue.

  8. Restart Xcode: In some cases, a simple restart of Xcode can resolve the problem.

  9. Duplicate File: Accidentally creating a duplicate info.plist file might cause confusion. Remove any duplicates from the project.

  10. Reference Other Files: If the "info.plist" file is referenced by other targets or build phases, verify those references are correct.

  11. Try a Different Machine: If all the above steps fail, try building the project on a different machine with Xcode installed.

  12. Last Resort: Reset Project: As a last option, you can try resetting the project without losing data. Go to "File" > "New" > "Project," then select the app template and click "Next." Choose the same project name and directory, and make sure to add the "info.plist" file to the new project.

Before attempting each step, save your project, as some actions might cause changes. These steps should help you resolve the "Build file cannot be found: info.plist" error in most cases. If none of these work, the issue might be more complex, and you might need to review your project setup more closely.

If you encounter an error in Xcode stating, “Build file cannot be found: info.plist, did you forget to declare this file?”, but the file is indeed present in the project. It seems like you may have moved the file but did not tell Xcode you did. Can you provide the screenshot of “Target” -> “Info” to see what it looks like? I see you navigate to it, but I think it got moved; you can just go to “Settings” -> “Target”, and in the “Info” tab, it will show you the file or let you reference one there. Below a few other things to check. However, you can move it back to the root of the project instead of “SupportingFiles”.

Here are some steps you can take to troubleshoot and resolve the issue:

  1. Verify File Location: Double-check the file path and ensure that "info.plist" file is correctly placed within the project's root directory or the appropriate group.

  2. Check Target Membership:

    • Select your project file in Xcode.
    • Navigate to the "Targets" section.
    • Make sure the "info.plist" file is included in the target membership for the build configuration where you're encountering the error.
  3. Validate File Type: Ensure that the "info.plist" file is correctly set as a "Property List" file in Xcode. You can verify this by right-clicking the file, selecting "Get Info," and confirming that the "Type" is set to "Property List."

  4. Clean and Build Project: Perform a "Clean" action first (Shift + Command + K), and then try building the project again (Command + B). This can help resolve any potential build cache or metadata issues.

  5. Delete Derived Data: Sometimes, Xcode's derived data can get corrupted and cause such errors. To delete derived data, navigate to "File" > "Clean Build Folder" > "Delete Derived Data."

  6. Check for Spelling or Naming Errors: Double-check the filename and ensure there are no spelling or naming mistakes. Even a small difference can lead to this problem.

  7. Validate Info.Plist Contents: Open the "info.plist" file in a text editor and ensure that it's a valid XML file. There might be some syntax errors causing the issue.

  8. Restart Xcode: In some cases, a simple restart of Xcode can resolve the problem.

  9. Duplicate File: Accidentally creating a duplicate info.plist file might cause confusion. Remove any duplicates from the project.

  10. Reference Other Files: If the "info.plist" file is referenced by other targets or build phases, verify those references are correct.

  11. Try a Different Machine: If all the above steps fail, try building the project on a different machine with Xcode installed.

  12. Last Resort: Reset Project: As a last option, you can try resetting the project without losing data. Go to "File" > "New" > "Project," then select the app template and click "Next." Choose the same project name and directory, and make sure to add the "info.plist" file to the new project.

Before attempting each step, save your project, as some actions might cause changes. These steps should help you resolve the "Build file cannot be found: info.plist" error in most cases. If none of these work, the issue might be more complex, and you might need to review your project setup more closely.

Xcode 15 build error Info.plist "error: Build input file cannot be found:..."
 
 
Q