'Xcode 10: A valid provisioning profile for this executable was not found

Since yesterday I've been getting the following error when trying run an app on my device:

A valid provisioning profile for this executable was not found."

This is after updating to Xcode 10. Building with Xcode 9 last week worked without issues. I've checked the other discussions about the error, but none of the solutions works.

The issue isn't limited to a single project I've been working on as it affects several all from different signing teams.

So far I've tried the following:

  • Cleaning project

  • Cleaning derived data

  • Uninstalling Xcode, deleting any preferences and files related to it.

  • Installing Xcode on a completely different Mac

  • Testing with different devices

  • Disabling device in developer profile and letting Xcode enable it again.

  • Deleting all certificates in the developer portal and recreating them

  • Unchecking and rechecking "Automatically manage signing"

  • Trashing the provisioning profile and letting Xcode recreate it

  • Creating a manual provisioning profile in the developer profile

The project contains no tests so there can't be a problem with wrong signing settings on that target. Date / Time is set to Automatic

One thing of note is that no Provisioning Profiles are listed here, except for the manual one I created: https://developer.apple.com/account/ios/profile/

I'd expect the xcode generated one to show up as they do for all other clients.

Below are the signing settings I'm currently using

provisioning profile settings

I've yet to try downgrading Xcode to an older version to see if that works. Other than that I have no idea of what to try next.



Solution 1:[1]

I was struggling with this today, it was super frustrating. For now, just go into "File" > "Project Settings..." (or in some cases "Workspace Settings...") and then select "Legacy Build System" from the "Build System" dropdown.

Solution 2:[2]

[edit] Note 2020: I used to manual sign this project. In projects where I automatically signed, I never had this issue. [/edit]

I had the same problem, and spent hours searching for an answer, removing profiles, cleaning project, and so on.

Have you distributed your app? You need to switch back to your developer profile, but not in General under the project settings, but in Build settings.

Under Signing, look at your Code Signing Identity.

Make sure that both your Debug and Release are set your iOS Developer, and not iOS Distribution; or your iOS Developer Provisioning profile, if not set to the automatic values.

The same goes with Provisioning Profile. It should be your developing profile, and not your distribution profile. enter image description here

Solution 3:[3]

@Stephen tks this resolved for me. I just need to go --> File --> WorspaceSettings --> Build Settings(change here to "Legacy Build System")enter image description here

enter image description here

Solution 4:[4]

I have tried all the above solutions.

However, in my case, after hours of headache it was because of the Test Project does not have a valid account for provisioning the signing. After I selected a team to provision in the Test Project with automatic managed signing. This problem went away.

Solution 5:[5]

Use clean build folder (command + shift + K) and rebuild app can shortly fix this issue. However, the build time will increase since you have cleaned the build folder.

Solution 6:[6]

So this won't be the case for everyone but I thought I'd post it here anyway as there doesn't seem be any answers relating to it.

In my case I was working on an app that was being developed in ReactNative, my issue was that although my signing was correct on the main app target the test target did not have any signing applied to it.
For some reason React Native requires that both your app target and your test target are signed in order to install the app on a device.
It does specify this in the official documentation on building for device however its the only instance I have ever seen where the test target is built alongside the app for anything other than testing.

In order to sign your test target, go to your project settings by opening the project navigator (?1) and select your project at the top.

Inside the main editor select your main app target under Targets (should have the same name as your project) and ensure the signing is correct, then select the test target (likely just under your main app target, it should be the same name with Tests appended) and make sure its signed in the same way.

Rebuild your app and it should now install successfully.

Credit for this goes to Leo Lei, his answer here saved me a lot of headache: https://stackoverflow.com/a/48657358/732844

As an aside, if anyone knows why react native requires your test target be built alongside your app target could they let me know? The only reason I can think of is to streamline the interface so react can build a single app and do both running and testing without needing to rebuild but i'm just guessing with that one.

Solution 7:[7]

In my case, here are the steps that I resolve the problems:

  1. Go to this folder: ~/Library/MobileDevice/Provisioning Profiles/
  2. Remove all the provisioning profile
  3. In Xcode 10 menu > Product > Clean Build Folder
  4. In Xcode 10 menu > Xcode > Preferences > Account > Download Manual Profiles
  5. In Xcode 10 menu > Product > Build / Archive

The reason to take the steps above is to remove the old provisioning profiles that messed up the building process.

Solution 8:[8]

For our team, nothing helped. We have spend a couple of days and tried out every step that was mentioned here above in answers and comments. We tried with XCode 10 and even XCode 9.2 on an App, that is on the App store since many years.

The issue began after upgrading to MacOS Mojave. Unfortunately, going back to HighSierra didn't help then.

At least we was able again to ship into App store after we've created new certificate and provisioning profile. But we still are not able any more to test our App in release mode on real device, which is necessary to test InApp-purchases.

In short: Archiving and submission works well, running on real device not!

Several developers, several devices, macbooks, XCode versions....

At the end we had to change the AppID for being able again to test on real device.

Therefor we run two different projects now: one for shipping to TestFlight/AppStore with the real AppID and one for development purposes with another AppID.

Although this only happens on ONE particular App of our company and not all the others, we expect to run into similar issues in the future as things get more worse with Apple's development tools...

Solution 9:[9]

I had follow all above steps but it's not work form me finally. I was created duplicate Target and it's working fine. I have no idea what's wrong maybe cache memory issue

enter image description here

Solution 10:[10]

I had this issue occurring in Xcode 10.3 after I switched over to my XCTest unit test target then back to the project run time target.

Turns out I had a different Teams selected in my provisioning profile for each target.

To fix it :

  • Clean Build Folder

  • Make sure all may targets are using the same Team. See Profile Signing under the general tab.

  • If not using same Team for all targets, clean before switching to a build target with

    different team selected.

Solution 11:[11]

Make sure the provisionning profile comes from the same team in both your target and your targetTests.

Solution 12:[12]

In my case, Device date-time was set to a future date. Changing the date setting to "automatic" fixed the issue.

Solution 13:[13]

Today I had the same error while installing an app to my device. The problem occurred after I updated to the new xCode 11.4.

What I did to fix the issue:

  • Unpaired device (Xcode > Window > Devices And Simulators > Left click device to unpair device.
  • Restart iPhone
  • Clean Build Folder (Xcode > Product > Clean Build Folder)
  • Clean Derived Data (in ../library/Developer/Xcode/DerivedData)
  • Clean Build Folder again (Xcode > Product > Clean Build Folder)
  • Build app on device.

Solution 14:[14]

I was struggling with the same issue and the solution in my case was to log in to the developer account(s). After updating to Xcode 10 all accounts were logged out.

Use the menu "Xcode -> Preferences ... -> Accounts" and make sure all accounts you use are logged in so the provisioning profiles are accessible.

Solution 15:[15]

I was using Xcode 13.3 swift 5, in my case only profiling on device/iPhone was throwing this error and I did the following:

1- go to project edit scheme

enter image description here

2- then go to profile tab info tab and then select building configuration debug

enter image description here

3- run profiling command ?+i

hope your problem resolved..... ??

Solution 16:[16]

Finally, I figured out what's going on... almost take me 2 hours

My case is, my phone's date is not correct. I forgot I changed my phone's date. I guess that makes all of my provisioning profiles expired...

So if you've tried all of those answers but nothing works. Go to the SETTINGS, check your phone's date.

Solution 17:[17]

You need to manually install the development provisioning profile on the device.

In Xcode:

  • Go to Window > Devices and Simulators: a new window appears.
  • Find your connected device on the left pane. Right-click on it and select Show Provisioning Profiles...: a new window appears.
  • Manually add your development provisioning profile.

Re-build the app on device.

Solution 18:[18]

Did you maybe change your developing device? It happened to me when I bought a new iPhone and gave it the same name with my previous device. A clean build however fixed the issue.

Solution 19:[19]

You just need to change your Team. In my case that worked

Solution 20:[20]

I had the case where my app would deploy to my iPhone but not my watch. Deploying to the watch would give the "A valid provisioning profile for this executable was not found." error. This is with XCode Version 11.2.1 and using the free developer account.

Here is what I did to get it deployed to my watch:

1) I deleted my provisioning profile in XCode. I did this by going to Window -> Devices And Simulators. Then right Click on the iPhone name and choose "Show Provisioning Profiles". From there I could delete the file

2) In The Devices and Simulators screen I also deleted my app from the "Installed Apps" section.

3) Did a "clean build folder" (Product -> Clean Build Folder)

4) In the "Build Settings" -> "Signing section" I made sure each target (iPhone, Tests and Watch) had the same settings (development team, code signing style, provisioning profile was set to automatic etc).

build settings details

5) Ensured the ~/Library/MobileDevice/Provisioning Profiles directory was empty.

6) Unplugged phone from computer

7) Rebooted computer, phone and watch

8) Plugged phone back into computer, and went through the "trust this machine" prompts on phone and watch.

9) Ran app. It worked!

Solution 21:[21]

I did the following :

  1. Disconnected the device where the app was not getting installed
  2. Connected a different device < It installed on this second device
  3. After some time connected the first device and it worked!

This is very weird but it worked for me, might work for others and save the frustration.

Solution 22:[22]

Be aware that accepted answer prevents build to be uploaded to App Store Connect.

Solution 23:[23]

Open Keychain Access on your Mac and delete the old expired Apple Development certificates. This solved the issue for me.

Solution 24:[24]

Check if you're using an Ad Hoc Distribution provisioning profile and not an App Store Distribution provisioning profile instead, I was getting this error because of that.

Solution 25:[25]

It takes a long time, and we did all the above solutions and they didn't work at all so our team decided to remove Pod files and run pod install again. finally, our OTA uploaded ipa installed on the user's device. best Solution

  1. clean project menu > Product > Clean Build Folder and /Users/{you user name}/Library/Developer/Xcode/DerivedData

  2. go to your project directory and remove Podfile.lock ,Pods folder,pod_***.framework

  3. run pod install again

Solution 26:[26]

In my case, where nothing else helped, i did the following:

  1. change the AppID to a new one
  2. XCode automatically generated new provisioning profiles
  3. run the app on real device -> now it has worked
  4. change back the AppID to the original id
  5. works

Before this i have tried out every step that was mentioned here. But only this helped.

Solution 27:[27]

For me even thou the distribution certificate and provisioning profile was available for Xcode, selecting Automatic manage signing during the distribute process made it fail. I did the following. As mentioned before I created a new distribution certificate and provisioning profile and then during distribute process manually selected the certificate and provisioning profile and Voilaaaa. Also made sure I am on the latest version 10.1.

Solution 28:[28]

It seems that Apple fixed this bug in Xcode 10.2 beta 2 Release.

https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_beta_2_release_notes

Signing and Distribution Resolved Issues

When you’re building an archive of a macOS app and using a Developer ID signing certificate, Xcode includes a secure timestamp in the archive’s signature. As a result, you can now submit an archived app to Apple’s notary service with xcrun altool without first needing to re-sign it with a timestamp. (44952627)

When you’re building an archive of a macOS app, Xcode no longer injects the com.apple.security.get-task-allow entitlement into the app’s signature. As a result, you can now submit an archived app to Apple’s notary service using xcrun altool without first needing to strip this entitlement. (44952574)

Fixed an issue that caused the distribution workflow to report inaccurate or missing information about the signing certificate, provisioning profile, and entitlements used when exporting or uploading an app. (45761196)

Fixed an issue where thinned .ipa files weren’t being signed when exported from the Organizer. (45761101)

Xcode 10.2 beta 2 Release can be downloaded here: https://developer.apple.com/download/

Solution 29:[29]

After I tired most of solution, I found what its make it work without any issue for me, Its resolved by go to developer.apple.com then account then Certificates, identifiers & profiles and I click on All link under Devices and then add a new device.

then you need to set device name, and uuid, and after save it. Go to xcode and clean cache, build, and all its work fine.

Note 1: make sure your team is set truth.

Note 2: You can get uuid by connect device to your mac device, and click on iTunes, and press on security label, you will see UUID.

Which This Answer its helpful too.

Solution 30:[30]

I did try all the answers above and had no luck. After that I restart my iPhone and problem seems gone. I know it is so stupid but it worked. Answers above most probably solves the problem but if not try to restart your iOS device.