Storyboard error in XCode 12.1. for systemColor resources

When I open the storyboard of a project created in older XCode with XCode 12.1, I get the following error message:

The document “Main.storyboard” had an issue that was found and repaired.
This may be due to an SCM operation such as merging. Please save the document to fix the issue.

WIth following details:

Multiple resources have the same name: darkTextColor.

I searched for darkTextColor in project, could not find any.
But opening storyboard as source shows that a line is duplicated

Code Block
<resources>
<image name="BoutonBackToStart.png" width="53" height="53"/>
<image name="BoutonCompter.png" width="79" height="79"/>
<image name="BoutonHelp.png" width="35" height="35"/>
<image name="BoutonPrefs.png" width="53" height="52"/>
<systemColor name="darkTextColor">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="darkTextColor">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>

However, the project compiles and runs without issue in Xcode 12.1.

I thus accepted to repair.
  • But next time I open, same error again.

  • So, I deleted manually the redundant line and error disappeared for good.

So, I looked at the project in XCode 11.3.
  • No error when opening storyboard.

  • Looking at the storyboard as source, I get the darkTextColor, but not in the resources section, but in various objects (as label subviews, under the key

Code Block
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>


So, it seems that XCode 12 converts storyboard with errors when moving key for color to the resources section, here duplicating an entry.

Did anyone notice similar issue ?

Accepted Reply

I had to update the project to recommended settings, as proposed in Issue Navigator.

That apparently removed the duplicate entry.

Replies

I had to update the project to recommended settings, as proposed in Issue Navigator.

That apparently removed the duplicate entry.