The identity used to sign the executable is no longer valid

This may happen when your certificate expire in your Key Chain.

EDIT : I'd now recommand cert and sigh to generate your certificates and provisionning profiles. These are two commands part of the fastlane tools from KrauseFx.

Using cert & sigh:

  1. Open a terminal and type cert
  2. Answer the prompted questions to sect your user, password, team, app, etc.
  3. Open a terminal and type sigh
  4. Answer the prompted questions to sect your user, password, team, app, etc.
  5. Select the right profile in Code Signing Identity (iPhone Developer)

Conventional way:

  1. Just go to the new provisioning portal : Certificates, Identifier, Profiles
  2. Login with your developer account.
  3. Go to Certificates and click the Plus button.
  4. Then select iOS Apps Development and click Continue.
  5. Follow the whole process and download the newly generated certificate.
  6. Download it and put it in your keychain.
  7. Update your profiles from XCode Organizer devices window
  8. Select the right profile in Code Signing Identity (iPhone Developer)

Neither restarting Xcode nor restarting my Mac helped.

Solution within Xcode:

  1. In Xcode, go to Preferences --> Accounts --> View Details
  2. Press the + symbol and select iOS Development
  3. Press the refresh button in the lower left corner (called Download all in Xcode 7)

PS:

  • Sometimes it may also help to delete invalid provisioning profiles: right-click -> move to trash
  • I saw this error exactly one year after signing up as an Apple developer.

Try restarting XCode. It worked for me.