Automatic signing is unable to resolve an issue with the target's entitlements file
I had this problem. Went to Target/Capabilities. Turned the following "On" - iCloud, In-App Purchase, Background Modes. Problem solved.
Make sure you're using your "Developer" profile and not your "Distribution" profile. Also make sure your app name is unique.
Remove DerivedData of your project and clean your project, then, reopen your Xcode.