Yesterday I update MacOS Sierra to MacOS High Sierra than I remove xCode 9.2 after that when I try to install xCode 9.3 from App Store, It gives me below error:
Xcode failed to download, Use the purchase page to try again
I tried below solutions.
1. Remove Account and again add it.
2. https://gist.github.com/ferbass/3ecc06a8ae992365bf73
3 https://apple.stackexchange.com/questions/61646/xcode-failed-to-download-use-the-purchases-page-to-try-again (But There's no Debug menu in MacOS High Sierra)
4 Try to install xCode with Different account but facing same error.
5 Other Applications are downloadable but facing error only in xCode installation.
below is screenshots
Solution
From How to fix / Reset App Store app on Mac OSX - El Capitan:
Delete:
~/Library/Caches/com.apple.appstore
~/Library/Caches/storeaccount
~/Library/Caches/storeassets
~/Library/Caches/storedownload
~/Library/Caches/storeinappd
I didn't have some of those folders, but I did have a couple of extras that looked fishy, so I deleted them too:
~/Library/Caches/storeassetd
~/Library/Caches/storedownloadd
Run sudo softwareupdate --clear-catalog
in Terminal
From http://osxdaily.com/2016/10/08/mac-app-store-temp-cache-folder/ (paraphrasing):
1. Quit out of the Mac App Store
2. Open Terminal and run open $TMPDIR../C/com.apple.appstore/
3. Hit Return and the com.apple.appstore
folder will open in the Finder of Mac OS
4. Delete the contents of this folder
And finally:
5. Navigate to ~/Applications
in Finder and move Xcode to the Trash [Note: This step was necessary for me, but ymmv]
6. Reboot
7. Launch App Store. Search for Xcode. Install it fresh.