I am getting the following error when building in Xcode 10.0 with swift 4.2:
In my case I got this error when I renamed a ViewController name using Refactor. The view controller name occurrences were changed but the real file not.
I tried to do what @ajji said but it didn't work. So I changed the name of the real file. After that all worked like a charm
If your file(s) - that couldn't find - icon color is pale. And you right click on it and "Show in Finder" does not open Finder. It means your file name is not same as what you see in the Navigator.
to Solve it, go to where your file exist, and change its name to be same as what you see in the Navigator.
This will resolve the issue as mine.
This works if you get the 'Build input file cannot be found error message' and also have files that are red in the inspector:
Open your project folder in Finder
Make a copy of the affected files onto your Desktop
Delete the affected files in Xcode and then close Xcode
Re-Open Xcode and drag your copied files into your Xcode project
This worked for me. Before I got the error message I was re-organising files in the file inspector which gave me that error message and made the files I was moving around turn red. Hope this helps !!
In my case the file wasn't at the right path, Xcode was expecting to find the input file at a path like /Users/Malloc/Projects/MyProject/Info.plist
while in reality the file was located at a different path like /Users/Malloc/Projects/MyProject/Subfolder/Info.plist
.
A quick fix to this is to simply right click on the file then select Show in Finder
, then drag the file to the correct path Xcode is expecting.
Adjust the file path according to that provided in the Xcode Error