Xcode 12 "Unknown Error" when signing in with Apple ID

I recently signed out of my Apple ID in system preferences since I am on a beta OS.
In order to run on device I need to be signed in with Xcode. However while trying to do so it gives me the "An unknown error occurred" message. I double checked on my password and was able to sign in with it on the web. I have not changed the password in the last year.
The same to me, this problem is still present:

Mac version: 11.2.3 Big Sur

Test it with: XCode: 11.7

Here's the solution https://apple.stackexchange.com/a/64960/225828

tl;dr - you should trash the /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist file.

Clean Derived Data: ~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex ~/Library/Developer/Xcode/DerivedData manually

Clear Xcode Simulator: Device > Erase All Content and Settings

Try Login Again: Xcode > Preferences > Accounts > + button > choose Apple ID

Make Sure:

Your VPN and DNS is offThe check those VPN/DNS, I uncheck all of the settings in System Preferences > Network > <Chose ur Network> > Advanced > Proxies > Uncheck all of those (in my Case)

Hope That Help, Cheers

What fixed for me - Make sure the iCloud account is at least logged into an iPhone (simulator also ok) and the error is gone!

Xcode 12 "Unknown Error" when signing in with Apple ID
 
 
Q