2 Errors when archiving

when I try to archive the project to distribute it to test flight I get these 2 errors

the first one is

Communication with Apple failed Your team has no devices from which to generate a provisioning profile. Connect a device to use or manually add device IDs in Certificates, Identifiers & Profiles. https://developer.apple.com/account/
 ....

which for some reason asks me add a device when it shouldn't be needed ... also the second issue is

No profiles for 'com.Name.AppName’ were found Xcode couldn't find any iOS App Development provisioning profiles matching 'com.Name.AppName’.

I have an app in App Store Connect and I have an identifier with the same bundle ID on my apple developer account

the app runs smoothly on the simulator but the problem mis with the archive....and yes I have the apple developer program

Things I tried:

  • Tried to refresh the certificate in Xcode
  • Removed my Apple ID and login in again
  • Removed the app from App Store Connect and creating a new one with different bundleID
  • Searched around multiple site (Apple fourms, Reddit, discord Swift Servers and other websites about this issue)
  • Restarted my Mac
  • Restarted Xcode
  • Cleaned the build

non of these did any thing to the errors

Answered by DTS Engineer in 808022022

You will need to have a device registered to your developer.apple.com account in order for Xcode to be able to generate a provisioning profile to sign your app.

You will need to have a device registered to your developer.apple.com account in order for Xcode to be able to generate a provisioning profile to sign your app.

but I don't want to use Ad Hoc ... as stated before I want to distribute using TestFlight via App Store Connect, there is nothing related to device registration in the official documentation Preparing your app for distribution

You will need to sign your app using a provisioning profile to send your app to App Store Connect.

2 Errors when archiving
 
 
Q