Solution To Error That A Valid Provisioning Profile For This Executable Was Not Found

Recently, I encountered the error that ‘ a valid provisioning profile for this executable was not found ‘ a few times. I googled them and solved them all.

The following are the solution helped me, so I collected and share some solutions to the ‘ a valid provisioning profile for this executable was not found ‘ problems in iOS development.

The one thing I want to stress firstly is to learn to google the solutions for your problems. Google is the best helper for programmers.

Okay, go ahead with the solutions.

Q1: XCode App installation failed – A valid provisioning profile for this executable was not found

I have already searched and almost implemented the max solution but it’s not installing any app even though if I am creating a just sample single view app.

A valid provisioning profile for this executable was not found

Please, let me know what I can do to fix a valid provisioning profile for this executable was not found.

Solution 1: 

First, go to ~/Library/MobileDevice/Provisioning Profiles. Make sure Xcode isn’t running. Then, delete all provisioning files (like xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.mobileprovision).
Start Xcode.
You will see something like “Fix this issue” in your Target’s General tab. Click it.
Xcode will now load new provisioning profile.
That’s it.

Q2: Frameworks/libswiftAVFoundation.dylib : valid provisioning profile for this executable was not found

I am re-signing a third party vendors app for enterprise distribution. I go through my usual re-signing process and it will install OK on an iOS10 device.

However, when I run the app it immediately crashes and I see the following in the debug log:

iPad amfid[224] : /private/var/containers/Bundle/Application/BB77EC6D-32E0-4762-B11B-9894799DD96C/ScannerPro.app/Frameworks/libswiftAVFoundation.dylib not valid: 0xe8008015: A valid provisioning profile for this executable was not found

Solution 2: 

Missing step was

codesign -f -s “iPhone Distribution: ” ‘–entitlements’ ‘entitlements.plist’ AppName.app/Frameworks/*

After doing this, and then resigning the overall app, the IPA launched successfully on both iOS9 and 10

Q3: None of the valid provisioning profiles allowed the specified entitlements

I am getting an error ‘No matching provisioning profiles found’ when archiving:

Code Sign error: No matching provisioning profiles found: None of the valid provisioning profiles allowed the specified entitlements: com.apple.developer.in-app-payments.

I added apple pay capability since the last time I archived successfully, so it’s probably to do with that. How do I add the entitlements to the provisioning profile?

The whole certificates/provisioning profiles/app id concept is so confusing, wondering if there are any good reads (for dummies) on exactly what/why/how these work.

Solution 3: 

You need to go to developer.apple.com and log in to your developer account. Go to the Certificates, Identifiers, and Profiles section, and find the app ID for your app. Click on it to expend the capabilities for the app ID. Make sure In-App Purchases is enabled for both development and distribution (more info here).

Apple developer app ID services screen

Once you’ve made sure it is there, you’ll want to re-generate the provisioning profile for the app ID, and then re-download the profile to your Mac.

I tend to remove all my old provisioning profiles when I do this since having multiple profiles for the same application ID can sometimes confuse Xcode. Provisioning profiles on your Mac are stored in /Library/MobileDevice/Provisioning Profiles/

After doing this, it isn’t necessary, but I usually recommend devs to quit and relaunch Xcode.

As for resources, I think Apple’s session, What’s New in Code Signing, from WWDC 2016 was a great one for understanding the components that are required for code signing to work.

Q4: No provisioning profile with a valid signing identity

No provisioning profile with a valid signing identity. No matching provisioning profiles found, Xcode, ios.

This message shows under identity –> Team

No provisioning profile with a valid signing identity(i.e. certificate and private key pair) matching the bundle identifier “com.myname.appname” were found.

Why is this?

I can test with the simulator, but cannot test with my iPhone.

Solution 4:

Since the release of Xcode 7, developers are allowed to test or run an app on any number of devices by logging in with your Apple ID. There is no need for paid Program membership of Apple.

Follow steps :

  • Add your Apple ID to Accounts preferences in Xcode.
  • Go to the General tab in Project and choose your team name from the Team pop-up menu.
  • Below the Team pop-up menu, click Fix Issue.

None of the valid provisioning profiles allowed the specified entitlements

When warning text under the Team menu disappears, Click the Run button.

Q5: Xcode could not find a valid private-key certificate pair for this profile in your keychain

Several days ago I created a profile and was successfully able to use it to run an app on my iPhone. However, I am using a different laptop for development and am unable to progress as I keep getting a “Xcode could not find a valid private-key certificate pair for this profile in your keychain”. I have tried the same iPhone/profile combination as I used previously, in additional I have another iPhone and have generated a new profile with that device’s id.

However, I get the same message with that profile/phone too. From other postings on this site seems people got this problem when the profile had not been dragged/dropped in the Library section of Organizer – I dragged the profiles on Xcode and there is a resulting Provisioning Profiles section containing the relevant profile in both the Library section and Devices section of Organizer.

The certificate is showing as being valid in Keychain Access. Any suggestions? Added Later: trying this Q&A from Apple:https://web.archive.org/web/20141029102125/http://developer.apple.com/library/ios/qa/qa1618/_index.html

They say within Keychain Access click on the .p12 file.

What are they talking about, what and where is the .p12 file?

It’s not shown in their own documentation screenshots and nor does it appear in my Keychain Access.

Is it supposed to?

Solution 5:

The best thing you can do is delete the certificates from your Keychain and get them back so XCode 4’s Organizer stops being “confused”. I’ve compiled it in 7 “easy” steps:

1- Delete your Certificates: Open the Application called Keychain Access on your Mac (You can hit the keys command + space bar on your keyboard to bring Spotlight and type Keychain Access to launch it).

Then select login on the upper left list and Certificates on the lower left the list, you will delete only the Certificates starting with the words “iPhone Developer” or “iPhone Distribution”.

2- You need to revoke the old certificates by logging into your Apple iOS Developer’s account and going to the Provisioning Portaland then to the Certificates option on the left menu.

Then locate your Developer Certificate and click on the link located at the right that reads “Revoke”.

3- Go back to the Keychain Access Application on your Mac, click on the menu bar the following menus: “Keychain Access” -> “Certificate Assistant” -> “Request a Certificate from a Certificate Authority”.

Just enter your email if needed and modify the option that says “Request is:” selecting the option “save to disk”… a dialog will ask you where do you want to save a CSR file which is normally called “CertificateSigningRequest.certSigningRequest“.

4- Go back to the online Provision Portal and create a new Certificate uploading the file you just generated on the same option where your old Certificates were before.

5- After a minute or so… you will see under the Certificates list that you can now Download your new certificate and that you can also download a WWDR intermediate certificate (See the links under the certificate list).

Download them and give them to your Keychain Access by double-clicking them.

6- You will have to go to the Provisioning Portal menu option called Provisioning where you will see all your App’s Development Provisioning Profiles.

You will have to click the link “Edit”->”Modify” at the right and verify that the Certificate is checked.

7- Finally, just close “XCode 4”. When you re-open it, go to the menu “Window” -> “Organizer”. Because the Organizer reads the certificates from your keychain, they should be there already.

Next time you plug your devices just click on Provisioning and make sure the old certificates are gone and the new certificate is on.

The above are some solution to the problems ‘ a valid provisioning profile for this executable was not found ‘, hoping these helped too.