Deleted class drops error message unknown>:0: error: no such file or directory:
Asked Answered
Y

3

19

So me and some friends working on a bitbucket project and already realized that bitbucket sometimes doesn't sync all the files. But here is what happened:

I continued working and created an class, I basically copied an old View Controller (called WelcomescreenViewController.swift -> CreateAccountViewController.swift) and made some adjustments in the main storyboard. Here I deleted all the old outlets in the new one and then made an own class for it as ViewController and connected it with it in the main storyboard.

What now happened is that there were some problems and I reverted everything and deleted both things again. And basically now Xcode still kind of thinks that there should be the class. It always drops the message:

enter image description here

I also made a screenshot from the directory with my files as it is now:

enter image description here

I tried to create the class again, so that Xcode is happy but it doesn't help. Is the file somewhere linked or what shall I do, to teach Xcode hey everything is fine, don't mind about the old file CreateAccountViewController.swift?

Yemane answered 17/1, 2016 at 22:56 Comment(4)
have you tried cleaning your build folder and relaunching Xcode?Proteose
yeah I did. Didn't help =/Yemane
Have your searched the entire project for occurrences of "CreateAccountViewController"?Coleridge
Just did it, didn't find anything left. So I don't know if there is somewhere a relation left in the settings somewhere or what is keeping the problem.Yemane
P
41

Make sure in your target settings, under Build Phases > Compile Sources that your file isn't listed there:

enter image description here

Also, just check it somehow hasn't been added to Copy Bundle Resources.

enter image description here

Proteose answered 18/1, 2016 at 12:37 Comment(4)
lifesaver... costed me like half an hour... thank youStome
Saved my day and/or days.Harridan
i have a file correct in Compile Sources.. but i don't know because have problems with xcode. maybe exists if others options respect this problemCollette
I wish I could up this answer 1,000 times. Helped SO muchBohrer
P
0

If you're developing a pod, and the deleted file is in the pod, try pod install to rebuild the framework.

Palimpsest answered 27/7, 2017 at 7:42 Comment(1)
I had one more target and I didn't update my Podfile with target 'XXX' do ... end. Thank you!Adenoidal
R
0

Check if the deleted files are still in Project, if yes, delete. build ...

Repellent answered 14/5, 2018 at 2:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.