Fix “Build input file cannot be found“ Error in Xcode

See how to fix the “Build input file cannot be found“ error in Xcode. It can be caused by different reasons.

Francesco Leoni

1 min read

Error

Build input file cannot be found

Complete error

Build input file cannot be found: 'path/to/file'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?

Problem

This pretty not understandable error can happen for multiple reasons.

May be, there was some merging conflict to apply and it went wrong.

Or in my case, it happened after I added a new target to the project.

Solution

The error was caused by excluding the arm64 architecture for the new target.

In the main target the wasn't any excluded architecture but in the new target Xcode added arm64 automatically to the Excluded Architectures.

To solve it:

  1. In the Navigator sidebar select your project
  2. Then, select the affected target in the Project and targets sidebar
  3. Go to Build settings and search for Excluded Architectures
  4. Double-click on the corresponding row and remove the arm64 architecture
  5. Clean your project (cmd + shift + K ) or for a hard clean (cmd + option + shift + K)
  6. Close Xcode
  7. Open your project again and build

Hopefully the error is now gone.

If you have any question about this article, feel free to email me or tweet me @franceleonidev and share your opinion.

Thank you for reading and see you in the next article!

Share this article

Related articles


CloudKit With CoreData Not Working in Production

Discover why sometimes the sync between CoreData and CloudKit do not work in production but it does while developing.

1 min read

Q&AErrors

How To Take an Xcode Simulator Screenshot without Shadows

See how to take a ready to use screenshot of the Xcode Simulator embedded in the device bezel without any shadow or toolbar.

1 min read

SimulatorXcode

Error “Missing package product“ for Swift Packages (SPM)

See how to fix the “Missing package product“ error in Xcode caused by some Swift Packages added through SPM.

2 min read

Q&AErrors