[ios] 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.

This question is related to ios xcode

The answer is


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.


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


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


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.


Encountered same issue, we've had multiple configurations in Xcode project, let's say Debug-Staging, Debug-Production. We then unified those and used only one configuration Debug. But the old one (no longer existing) was stuck in scheme for run phase, so once you tried to run, Xcode showed you this message. Which makes sense as provisioning profiles are set up in build settings based on configuration.

So run scheme looked like this:

Incorrect target scheme

While project configurations were setup like this.

Project configurations

Changing scheme to use configuration that is still available in project is what fixed this issue for me.


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.


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


I had the same issue (XCode 11) and nothing worked what was written here.

My issue was that I had iOS Beta (13.3) on my Phone. After reverting that everything worked fine again.


Idea: Maybe the device caches some Information about the provisioning profile too, so a factory reset of the phone might also fix it?


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


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.


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.


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.


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.


I've tried all the other answers, but (surprisingly) none of them have worked for me. In the end, I figured my development account has to be "Trusted" by the device for it to run.

This can be configured in your iOS device, under Settings > General > Device Management > Developer App. You should ensure your account is marked as trusted.


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.


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.


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


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.


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.


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.


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/


I had to change my team in provisioning profile for tests. AND

Changing my target device from my physical phone to a simulator fixed it for me!


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

Done


Make sure you:

1) Have a registered provisioning profile for your device.

2) Device must be added to the Development profile and updated.

If you still run into issues check your target's build settings.

Make sure you:

1) CODE_SIGNING_REQUIRED in User-Defined is set to YES.

enter image description here

2) Check Signing options are correct. If the problem persists switch to Manual settings instead of automatically.


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.


For me it worked to delete a Capability and then add it back.

Capabilities tab


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


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!


[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

Hope this will help future developers in need.


I just disable my device from Apple Developer then problem solved. (tested many times on Xcode 12.4)


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.


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...


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.

@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


Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to xcode

Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 iPhone is not available. Please reconnect the device Make a VStack fill the width of the screen in SwiftUI error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Xcode 10: A valid provisioning profile for this executable was not found Xcode 10, Command CodeSign failed with a nonzero exit code