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,<
The above steps resolved the issue for me.
MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)
macOS Mojave Version 10.14.6 (18G87)