This solved the problem for me (using Xcode 12.5):
"Edit scheme..." > Uncheck the "Parallelize Build" option under "Build Options".
Now the "No such module..." error is gone and I can do Archiving. It's a good idea to reset the SPM cache, do a Clean Build and remove derived data before trying to archive again after toggling the option to Off.