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

前端 未结 26 2184
忘掉有多难
忘掉有多难 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:50

    I had the same problem with a missing view controller file that couldn't be found after cloning a project in a new folder. I deleted the view controller but the compiler continue asking for a file in a path that doesn't exist anymore.

    I solved the problem as follows:

    • Select the project target in the Project-navigator,
    • Go to Build Phases tab
    • In Compile Sources section, check for the file that the compiler is asking for. You can filter by the name at the top right of the screen.
    • The deleted file is still on the list with a wrong path, delete it by clicking on the minus icon. You have to do it for all the target you may have.
    • In the case that you still use the file, add it on a new path by clicking the plus icon.
    • Clean Build Folder in the Product Menu.

    It should work now :D

    (Objective-C Project / Xcode Version 10.2.1 (10E1001))

提交回复
热议问题