mistake
clang: error: no such file or directory: ‘/Users/dcsnail/Desktop/…/SomeClass.m’
clang: error: no input files
solve
Searching for the current class name in Xcode
, you will find that the same file has been added twice or compile sources
imported twice in . Removing the wrong one fixed the problem.
After I searched, I found a Recovered References
folder with duplicates. After deleting it, the build passed. This folder was not added manually by me, so how did it appear? Please see below.
Caused by
Let's first introduce the environment, this project uses git
to manage the code. When a team member creates A
a Xcode
new empty folder, that is, one New group
, there are no files in this folder. At this time, B
after pulling the code, the member will find that A
the folder just uploaded is red, but it does not exist, because git
the empty folder will be automatically ignored.
Then, at this time B
, it is found that there is no such folder, so I create a new folder with the same name locally, and then A
also operate the contents of the folder I created before, which will cause this conflict. When the conflict was resolved, the auto-generated Recovered References
folder was not found, which caused this problem.
Related article: I'm getting “clang: error: no input files”