I created an archive for any project in Xcode 9. Then I try to create an ipa file (either development or ad-hoc). I first try to export the archive. Then I select either Dev
In my case this was due to a pending Apple license agreement that was causing Xcode's automatic provisioning to crash.
Log onto developer.apple.com and make sure you do not have a license update pending agreement.