错误: clang: error: no such file or directory: '/Users/...', clang: error: no input files

mistake

write picture description here

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 sourcesimported twice in . Removing the wrong one fixed the problem.
After I searched, I found a Recovered Referencesfolder with duplicates. After deleting it, the build passed. This folder was not added manually by me, so how did it appear? Please see below.

write picture description here

Caused by

Let's first introduce the environment, this project uses gitto manage the code. When a team member creates Aa Xcodenew empty folder, that is, one New group, there are no files in this folder. At this time, Bafter pulling the code, the member will find that Athe folder just uploaded is red, but it does not exist, because gitthe empty folder will be automatically ignored.
write picture description here
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 Aalso operate the contents of the folder I created before, which will cause this conflict. When the conflict was resolved, the auto-generated Recovered Referencesfolder was not found, which caused this problem.

Related article: I'm getting “clang: error: no input files”

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325409808&siteId=291194637