'Build input file cannot be found' Swift 4.2, Xcode 10.0

前端 未结 26 2137
忘掉有多难
忘掉有多难 2021-01-30 10:16

I am getting the following error when building in Xcode 10.0 with swift 4.2:

相关标签:
26条回答
  • 2021-01-30 10:28

    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

    0 讨论(0)
  • 2021-01-30 10:28

    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.

    0 讨论(0)
  • 2021-01-30 10:30
    • Goto Project Navigator.
    • Click on project.
    • Click on Targets.
    • Goto Build Settings.
    • Search Prefix.pch.
    • Change the location of this file (input the updated location).

    This will resolve the issue as mine.

    0 讨论(0)
  • 2021-01-30 10:31

    This works if you get the 'Build input file cannot be found error message' and also have files that are red in the inspector:

    1. Open your project folder in Finder

    2. Make a copy of the affected files onto your Desktop

    3. Delete the affected files in Xcode and then close Xcode

    4. 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 !!

    0 讨论(0)
  • 2021-01-30 10:33

    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.

    0 讨论(0)
  • 2021-01-30 10:33

    Adjust the file path according to that provided in the Xcode Error

    0 讨论(0)
提交回复
热议问题