How to resolve error showing like filename used tw

2019-05-11 10:42发布

问题:

I am working in swift with Xcode 7.3.1. Now i got error showing like file name used twice and i am stuck with this following error.

<unknown>:0: error: no such file or directory: '/Users/mac/Desktop/develop/myApp/Manager.swift'
<unknown>:0: error: filename "Manager.swift" used twice: '/Users/mac/Desktop/develop/myApp/Manager.swift' and '/Users/mac/Desktop/develop/myApp/MyApp/module/Manager.swift'

Could you please help me

回答1:

I had a very similar issue, so hopefully this helps.

Open your project file (ProjectName.xcodeproj) in a text editor (I chose Sublime), and then search for the file entry (Manager.swift). If you find two entries for it in there, then delete one. If you are not sure if you will delete the right one, you can delete both and then re-add the file to your project afterwards.

Since you are editing your project file, it is highly recommended to make sure you have a fresh commit prior to this to avoid any potential loss of data.



回答2:

I had actually the same problem. I found solution in Recovered References folder. Just removed reference to FileThatUsedTwice.swift Hope it will help you