Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode shows "The document had 4 issues that were found and repaired./Multiple resources have the same name: groupTableViewBackgroundColor." alert

If I open one of the storyboards in my Xcode project, I get this alert:

"The document [storyboard name] had 4 issues that were found and repaired." error alert

The document [storyboard name] had 4 issues that were found and repaired.

This may be due to an SCM operation such as merging. Please save the document to fix the issues.

Multiple resources have the same name: groupTableViewBackgroundColor.

I tried saving the document, but the error kept popping up.

What is this and how can I fix this?

like image 986
Tamás Sengel Avatar asked Oct 13 '20 22:10

Tamás Sengel


1 Answers

This error looks like to be an Xcode bug, as I cannot recall having merge issues with my storyboard. It can be fixed by editing the storyboard's source code. Here's how you can do it:

  • Right click on your storyboard in the Project navigator and select Open As/Source Code.

Open As/Source Code

  • Search for the following term in the file by pressing Cmd+F:

    <systemColor name="groupTableViewBackgroundColor">

  • Delete all instances. I've had 5 color instances named groupTableViewBackgroundColor for some reason. Since storyboards are XML-based, the definitions end with </systemColor>:

    <systemColor name="groupTableViewBackgroundColor">
        <color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
    </systemColor>
    
  • Right click again on the file, select Open As/Interface Builder - Storyboard and the error should go away.

If the error still persists, delete and re-add the storyboard file.

like image 83
Tamás Sengel Avatar answered Oct 08 '22 01:10

Tamás Sengel