Interface Builder was unable to determine the type of "Main.storyboard". This may be due to a missing SDK

I had the same exact issue. I would not delete it, instead I used grep to locate the file in my project directory i.e. '$grep -r "Main.storyboard" .'

Once you find it, you can use an editor (vim or perhaps emacs) to view the actual file, since it may either be corrupted, but in my case I was merging in a branch that appended to the file during automerge:

    <<<<<<< HEAD 
    document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="gHi-tD-tmJ"
    =======
    document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"
    >>>>>>> develop

If you happened to have this same issue as I did, just delete either the head or the tail of this - whichever you don't want. If you have issues with resolving conflicts, refer here:

https://githowto.com/resolving_conflicts

or

https://help.github.com/articles/resolving-a-merge-conflict-from-the-command-line/


This is less complex than you think.

The error is because you mistype something on the source code of Main.storyboard, for example I accidentally put an "ƒ" before the first open tag of Main.storyboard.

1) What you must do is to delete Main.storyboard (select throw to Trash)

2) Go to Trash, move the Main.storyboard to desktop, open with any text editor and fix the code; then "select all" and "copy".

3) On Xcode, create a brand new Main.storyboard and then press Right click on file and select Open As -> Source code, then paste the fixed code that you have on your clipboard.

4) Right-click on file and select Open As -> "Interface Builder - Storyboard".

Hope it works for you.

Tags:

Ios

Xcode

Swift