Same here, On a top of all other previously mentioned tricks I also tried to delete ~/Library/Caches/org.swift.swiftpm as well, but nothing happens.
It starts happening when I switch to different branch in git and only way to make it work is to reinstall Xcode.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: