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?


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.


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.

Thank you for reading

What are you thoughts about this? Tweet me @franceleonidev and share your opinion.

Source link