I tried almost anything above, including restarting XCode, none of them worked for me. I solved this problem by simply restarting my Mac. Yes, the classic solution.
A side note: This problem occurred to my XCode after it requested my Mac password from me, probably after an automatic upgrade.