I avoided the error by following the steps below.
Access the certificate from the Apple Developer site.
Download the certificate.
Drag the downloaded file into Xcode.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: