I\'m using the Mac OS to install the XCode10.1.
I have 18.43GB free disk space in the mac,
but when I click the install button on the Xcode from the app store,<
Same thing occurred to me when I was trying to install xcode 12.0.1 from app store even though I had around 40GB of free space and the xcode 12 is taking only around 12GB. This helped me resolve the issue.
cd ~/Library/Developer rm -rf Xcode
Hope this will help for someone in need.