Xcode schemes and targets messed up

I was having trouble with Xcode and it was telling me that multiple versions of derived data were being produced and I could not build the project. I started to mess around with some build settings and finally got the issue fixed and the project built. However, now when I run the project on my iPhone, my app icon does not appear and the app crashed immediately with the error:

Could not find a storyboard named 'Main' in bundle NSBundle


I realized that something was wrong with my project. Something looks different on the sidebar now, and when I click on my actual Xcode project, it does not show me the general information like normal.


Instead, it shows me the general information in under the Target "Hostend" instead of the project like it usually would. Also, my Assets.xcassets, my Main.storyboard, and any of my other files don't have the Target Membership checkbox checked for my target, and I cannot enable it because it is grayed out.


What is happening with my project and how can I fix this? I'm really stuck and I need help. This is extremely urgent as my app completely crashes at launch now.


EDIT:

Actually, good news and bad news.


I was able to resolve the issue. Turns out I had accidentally deleted the Copy Bundle Resources build phase. To restore this phase, I clicked on my project in the Project Navigation, clicked on the Build Phases tab, and then I clicked the + button and clicked the New Copy Bundle Resources Phase button. I then added in all of my bundle resources. That's the good news.


Bad news, I have a new error. Now the compiler says:

Build system information

error: Cycle inside Hostend; building could produce unreliable results. This can usually be resolved by moving the app extension embedding build phase to the end of the list.

Cycle details:

→ Target 'Hostend': LinkStoryboards

○ Target 'Hostend' has compile command with input '/System/Volumes/Data/Users/michaelderiso/Desktop/Developer/Hostend/Hostend/LaunchScreen.storyboard'

○ Target 'Hostend': ValidateEmbeddedBinary /Users/michaelderiso/Library/Developer/Xcode/DerivedData/Hostend-gjaxiqkofklirhbihjmyftldzdvr/Build/Products/Debug-iphoneos/Hostend.app/PlugIns/GiftRegistryShareExtension.appex

○ Target 'Hostend' has process command with output '/Users/michaelderiso/Library/Developer/Xcode/DerivedData/Hostend-gjaxiqkofklirhbihjmyftldzdvr/Build/Products/Debug-iphoneos/Hostend.app/Info.plist'

○ Target 'Hostend' has compile command with input '/System/Volumes/Data/Users/michaelderiso/Desktop/Developer/Hostend/Hostend/LaunchScreen.storyboard'


What does this mean?


ANOTHER EDIT:


I fixed the issue. It literally told me what to do and I did not read it through.

Replies

How large a project is it ?


If what KMT suggests doesn't get you out, and if not a huge project, the best is probably to completely rebuild the project from scratch, recreate the storyboard (I know, that can be tedious if many views and lot of constraints). Do not copy and paste from old corrupted project.


And a lesson, make frequent (once everyday at least after significant changes) backups of the WHOLE project (the complete folder).

It's a very large project (worked on it for about 1 year). I do have backups, but they are from about a week ago. I might just have to go back to those and recreate any changes I have made.

I fear that's the best solution.


To handle such cases, I usually mark in projects the modifications that are being done, with a label as the date of change.

That allows me to find what has changed in the files.