Xcode 8 A valid provisioning profile for this executable was not found

Donald Jackson picture Donald Jackson · Oct 27, 2016 · Viewed 45.7k times · Source

I know there are other questions asked like this here but I've followed all their solutions yet still end up with this error message.

I've spent a ton of time trying to figure this out now I'm hoping someone else has felt my pain and actually solved this.

UPDATE: Adding screenshots for usefulness

UPDATE 2: I gave up trying to solve this problem, I created a new project and copied source files into the new project and I now have it working. Clearly something in the project configuration/settings files got corrupted somehow in the previous project which no obvious fix available. Will leave this question open, perhaps someone has a solution eventually. I have my old 'non-working' project so will continue to try those just for curiousities sake.

Current Settings

Before this error message, Build Succeeded is shown.

Error Message

Device ID - matches profiles

List of profiles on device

Answer

Leo Lei picture Leo Lei · Feb 7, 2018

ATTENTION!

Who should read

If you were developing with a "Personal Team" and is switching to a paid team, then you'll get this error if you have not updated your other targets as well.

The cause

Since I'm using react-native, I happen to have a target for test (i.e. a target called appTests), and switching the team just in one target wasn't sufficient, and leads to this error. This error isn't informative enough to let you know there's an error in one of the targets, therefore leading to a long debugging time for myself.

Solution

1) On Xcode 9, go to every targets and update the team!

2) Unfortunately, the next steps aren't very reliable from my experience, you might have to do your best to clean the caches.

3) Stop every single running scheme/application by using the stop button

4) Go to Product -> Clean and cleans every schemes you use.

5) Quit and Restart Xcode

6) Run again and hopefully it works! If not, it's likely some cache are still present.