I experienced the same issue with a Flutter build using Xcode 15.3. In my case, I went to the Xcode menu in Xcode, then Settings, then Accounts. My Apple ID was showing a "Your session has expired. Please log in." error. Unclear why because I don't recall experiencing this before. Signing in with my Apple ID again then fixed the issue and allowed the build to complete successfully.