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

1

5

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?

Advocation answered 13/10, 2020 at 22:36 Comment(0)
A
6

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.

Advocation answered 13/10, 2020 at 22:36 Comment(4)
Excellent answer. Spot on. Thanks!Aside
It works, but as you have noticed already, the error comes back after a while. I ended up removing all references to groupTableViewBackgroundColor and darkTextColor from the Storyboard and work around it.Dunnite
@MarioHuizinga I've edited my answer. It looks like you should delete all instances of the groupTableViewBackgroundColor systemColor definition.Kenwood
Exactly what I was looking for. Many thanks! However I deleted all but one, and so far the the error didn't come back.Stalnaker

© 2022 - 2024 — McMap. All rights reserved.