[xcode] Problems after upgrading to Xcode 10: Build input file cannot be found

I upgraded my Xcode SDK to version 10 last night and then find I cannot build.

I'm getting this error:

Build input file cannot be found: '/Users/call01/Library/Developer/Xcode/DerivedData/Comp-Lite-Apps-gytvmossqptokeafrddvvmnlzadk/Build/Products/Debug-iphoneos/SG11.app/SG11

which did not exist before my upgrade and I'm tempted to revert back but would like to stick with version 10 if I can resolve this issue.

This question is related to xcode upgrade

The answer is


I had the same issue. The problem was that I didn't have any file under the Target > Build Phases > Compile Sources. The problem was solved after I added at leas one file to Compile Sources.


open the right navigation pane where your project files exist OR JSUT click on cmd + 1 Then search for "Recovered References" Folder open it all red files (delete them) then everything will work so fine .


In my case, the file (and the directory) that XCode was mentioning was incorrect, and the issue started occurring after a Git merge with a relatively huge branch. To fix the same, I did the following steps:

  • Searched for the file in the directory system of XCode.
  • Found the errored file highlighted in red (i.e, it was missing).
  • Right clicked on the file and removed the file.
  • I tried building my code again, and voila, it was successful.

I hope these steps help someone out.


The above solution eventually works for me; however, I need to do some more extra steps to finally make it to compile successfully. (These extra steps were required even on Xcode 9.)

  1. Xcode: File -> Workspace Settings -> Build System: Legacy Build System
  2. Xcode: Product -> Clean
  3. Rotate to compile thru different emulator types, such as "iPhone 8", "iPhone 8 Plus", etc. (They might fail or might not.)
  4. Eventually compile on "Generic iOS Device"

Not that I did anything wrong, but I ran into this issue for a completely different reason and kinda know what caused this.

I previously used finder and dragged a file into my project's directory/folder. I didn't drag into Xcode. To make Xcode include that file into the project, I had to drag it into Xcode myself later again.

But when I switched to a new branch which didn't have that file (nor it needed to), Xcode was giving me this error:

Build input file cannot be found: '/Users/honey/Documents/xp/xpios/powerup/Models Extensions/CGSize+Extension.swift'


I did clean build folder and delete my derived data, but it didn't work until I restarted my Xcode.


In my case I accidentally deleted one third-party xcodeproj folder I used in my app.


I fixed this issue this way: go to your project's Build Phases (click on project icon at the top, and then click on Build Phases). Search for your file there. If it's there (it'll be grayed out), delete it. Then clean (shift + alt + command + k), and run! Hope it helps.


For me In Xcode 10, this solution worked like a charm. Just go to the Recovered References folder and remove all files in red color and add it again with proper reference. If Recovered References folder was not found: Check for all missing files in the project (files in red colour) and try to add files references again.

enter image description here


None of the above worked for me, but this did:

  1. Open project in Finder, right click on your .xcodeproj file and show package contents
  2. Open project.pbxproj in a text editor
  3. Find the reference to your missing file
  4. Edit path = "path/to/file.swift" to the actual location on disk and save the file.
  5. Rebuild the project

In my case, I had created a new test target and deleted the default swift file so it was left with just the info.plist. Adding a new file fixed this.


  1. Go to Xcode-> File -> Project Setting
  2. Change Build System:-"Legacy Build System".
  3. Clean,Build and hit Run.

The "Legacy Build System" solution didn't work for me. What worked it was:

  1. Clean project and remove "DerivedData".
  2. Remove input files not found from project (only references, don't delete files).
  3. Build (=> will generate errors related to missing files).
  4. Add files again to project.
  5. Build (=> should SUCCEED).

This worked for me in Xcode 10:

  • Click Project icon/name in your Xcode project
  • Go to General tab
  • Click [Choose info.plist File] under Identity section
  • Select the info.Plist file
  • Check Info tab to see if info.plist was loaded successfully
  • Build and run

I ran into this error after renaming a file. Somehow Xcode didn't correctly rename the actual file on disk.

So it wasn't able to find the file. Sometimes the files gets highlights with a red text color. At other times the Swift icon in front of the file was getting a gray overlay.

The fix was simple.

  • Look into the error and see exactly which file it's unable to find.
  • Select the file that can't be found.
  • Go to the 'File Inspector'. It's on Xcode's right navigation pane.
  • Click on the folder icon.
  • Select the correct file.
  • Clean build and run it again.

File>Project Settings>Change Build Systems to Legacy Build Systems


I know that this is an old subject, but I found the issue with xcode 12.3 and was related to an error while doing the CopyPlist of the main.Storyboard during compilation.

Actually, changing the build settings to "Legacy Build Setting" worked, but it is deprecated, so I discarded it because is a short term solution.

Check this:

enter image description here

With that setting, worked for me. Before I had "Copy plist".


What Xcode was complaining about was a XIB file I got it working by going to Project -> Build Phases -> Copy Bundle Resources, removing the "problematic" XIB, cleaning (CMD+Shift+K), building and adding it back again.


Just check the path to .plist file in Build Settings of your target

enter image description here


I had a similar issue after upgrading to a new swift version recently. Moving files around caused my xcode project to reference items that were no longer in the project directory giving me the Error Code Build Input File Not Found.

In my situation I somehow had multiple files/images that were being referenced as described below:enter image description here

In the image above.

  • Navigate to your Targets page.
  • Then Click on the Build Phases tab on the top.
  • Scroll Down to Copy Bundle Resources
  • Find the affected files and remove them. (hit delete on them or select them and hit the minus button )

It was in here that I somehow had multiple files and images that were being referenced from other folders and the build would fail as they could no longer find them. And I could not find them either! or how Xcode was still referencing them

I hope this helps someone else !


This worked for me

  1. try deleting the red colored files
  2. delete the files in derived data
  3. clean the build folder
  4. then try building by using "new build system" from file->workspace settings

For Swift files or files that belong to the project such as:

Build input file cannot be found: PATH/TO/FILE/FILE.swift

This issue can happen when files or folders have been removed or moved in the project.

To fix it:

  1. Go in the project-navigator, select your project

  2. Select Build Phasestab

  3. In Compile Sources section, check for the file(s) that Xcode is complaining of

  4. Notice that the file(s) have the wrong path, and delete them by clicking on the minus icon

  5. Re-add the file(s) by clicking the plus icon and search in the project.

  6. Product > Clean Build Folder

  7. Build

You generally find these missing files in the Recovered References folder of Xcode in the project tree (look for the search bar at the bottom-left of Xcode and search for your complaining file):

Deleting them from this folder can also solve the error.


I had this happen for building my unit tests. This may have happened because I deleted the example tests.

I removed the Unit test bundle then re-added it as shown in the pictures below and all was well again.

enter image description here

enter image description here


Funnily, closing Xcode and reopening it might also be enough.


There is also one possibility that sometimes when you move your files to different folder and especially when you move your info.plist to other folder, you need to define the location of that file. To solve this problem, simply click on your project blue icon on the top, and you will see a button in place of project name and bundle id, click on it and locate the info.plist file there, clean and compile happily.


If you tried profiling, and then it didn't work, and now you cannot build, go into your Target pane (via the Project Icon), Switch to the Build Settings tab, search for PROFILE - and set CLANG_USE_OPTIMIZATION_PROFILE to "No".


I ran into this problem soon after upgrading to Xcode 10, but that was not the issue.

I tried changing the build system, but that gave me a separate error that meant the same thing. Generally saying "File X can not be found".

There are multiple things to check when a file can not be found.

  1. Recovered references Folder Apple does this nice thing where if it detects a reference to a file that doesn't exists it will add this reference into a group called "Recovered References"

That is nice of Apple but it doesn't always work.

  1. Build Phases Compile Sources In this list, there could be meta data for a file that the project is suppose to compile, but the file does not actually exists and it's attempting to find the file at the given path. In this list it will be dimmed out, delete them and re-add them by toggling the file's target dependencies or manually removing it and dragging it in.

  2. File's Path Double check the file path that the error is printing out and the file path for the file in finder. You can easily see this by clicking on the file in Xcode and checking the "Show the file inspector" tab (the left most tab). If these paths are correct then you are good!

  3. Dimmed out files in your project that are not in recovered references or red This one pissed me off because it's not obvious about what happened, but basically if you go into finder and move a file to a different location with out updating the reference in the project it will throw the error as the file no longer exists there. The only indication I have found for that is that the file in the "Project Navigator" tab (left most tab) is very slightly dimmed, but when you go to delete this file Xcode doesn't prompt you to delete the reference or send to trash. You can fix this by deleting the file and re-adding it to the project or going to the "File Inspector" tab and click the folder icon next to the path and change it to the proper location.

Either way, the error indicates that it can't find a file, switching to the old build system is a bandaid for a more concrete issue. We as developers understand that a compiler just wants an artifact to be listed at the end of a file path. Somewhere the path is not correct! We have to find where that is!

My issue was resolved with item 4 listed above. Hope this helps somebody.


In my case I had a build script that generated the .app binary (Buck). The Buck build script ran in parallel with Swift Embed build step. Because the .app binary was not generated yet the Swift step would fail.

In my build script I added "$BUILD_PRODUCTS_DIR/$EXECUTABLE_PATH" under "Output Files".

This tells Xcode's New Build System that this script will output the app Binary and in turn Xcode will make sure to synchronize any build steps that depend on this artifact.

enter image description here


If the error says it can't find Info.plist and it's looking in the wrong path, do the following:

  1. Select your project from the navigator, then select your target
  2. Select "Build Settings" and search "plist"
  3. There should be an option called Info.plist File. Change the location to the correct one.