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.
  • 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

Add a Comment

Replies

The same to me
Did you ever sort this out? I’m having the same issue and cannot sign in for some reason.
Any update on this issue. I'm also experiencing it. Running XCode 11.6 and MacOS 11 Beta. Any solutions available?
Getting the same error in Xcode 11.6 & now the same in Xcode 11.7 as well. Tried restarting multiple times but still no clues.
The same to me. I will keep an eye on the solution of the issue.
I am also facing this same issue for quite a while.
  • MacOS Big Sur 11 (Beta 6)

  • Xcode 11.6


Any updates? We cann't work on BigSure just cause of this little thing.
I had same issue. I had to download latest XCode Beta from developer website, and it worked to sign in with it. The default XCode from App Store didn't work.
same here
Same here, any update?
Same here - on Version 12.0.1 Anybody resolve this?
the same here....and there are no responses from apple...
I had this problem and came across this link: https://wwwsunzala.com/fixed-apple-id-an-unknown-error-occurred/

The author states:

Did you notice you cannot add Google, Yahoo or other accounts too? I could not and after noticing this I realized the problem has nothing to do with iCloud or Apple server. It’s just my local machine which needs a fix.
After days of investigation, I found the Accounts/ iCloud local database is damaged and I have to reset it.

I was pretty skeptical but held my breath and ran this:

Code Block
sudo -v ; killall -9 accountsd com.apple.iCloudHelper ; defaults delete MobileMeAccounts ;
mkdir ~/Library/Accounts/Backup; mv ~/Library/Accounts/*.sqlite* ~/Library/Accounts/Backup/ ;
killall -9 accountsd com.apple.iCloudHelper ; sudo reboot

It worked! :shrug:
This problem is still present:

Mac version: 11.1 Big Sur

Test it with:
XCode: 11.7
XCode: 12.3

The apple ID is a business email from G-Suite.
You mustn't add any spaces after the email and password, or you will fail.....