iOS app submission : invalid signature - ios

I'm struggling with this issue for more than a week now, I've tried all I could find on Google with no luck. This is my first time trying to submit an app to the App Store, but I keep getting this email after each try:
invalid Signature - Make sure you have signed your application with a
distribution certificate, not an ad hoc certificate or a development
certificate. Verify that the code signing settings in Xcode are
correct at the target level (which override any values at the project
level). Additionally, make sure the bundle you are uploading was built
using a Release target in Xcode, not a Simulator target. If you are
certain your code signing settings are correct, choose "Clean All" in
Xcode, delete the "build" directory in the Finder, and rebuild your
release target.
so here is what I'm doing:
I have my distribution certificate in login keychain , with the
private and public key .
I have the distribution provisioning profile with the same certificate i've created earlier .
The bundle ID on my provisioning profile is the same on my iTunes connect app and the
same in Xcode general settings .
The same version (0.8.2) in iTunes connect app and Xcode .
I'm building with device selected not a simulator (but i don't have a device connected to the mac).
the code signing part under build settings (for both target and project).
I have "iPhone Distribution : ... " for everything and also i'm selecting the distribution provisioning profile .
What I am missing? I've looked all over and all I find is people with incorrect versions or incorrect bundle id.
I am using Cordova and Ionic to build my app, I don't know if that has something to do with it.
I've seen the troubleshoot guide of Apple on this issue and ran this command:
codesign --verify -vvvv -R='anchor apple generic and certificate
1[field.1.2.840.113635.100.6.2.1] exists and (certificate
leaf[field.1.2.840.113635.100.6.1.2] exists or certificate
leaf[field.1.2.840.113635.100.6.1.4] exists)' /path/to/the.app
I get : a sealed resource is missing or invalid file modified: /path/to/MyApp.app/MyApp
they suggest to run this to resolve the issue: dot_clean path/to/xcodeproject
But that didn't help, I keep getting the same error.
Please help, I'm out of clues
EDIT ( Solution )
Apple is just a big stupid company, none of the suggested solutions under any of the posts helped me ! it was just the stupid process of apple , I had an invalid character "?" that should have been removed from the App Name. I wish Xcode coulde validate the name first before going into any of the submitting and testing process.

I think you are not using the proper distribution profile.Create a new distribution profile in itunes connect for app store submission not the ad hoc one. see the below image.
1)Then, check your bundle identifier that should exactly match with the newly created appstore certificate.
2)Just Delete your certificates in Provisioning Portal and update the new certificate in Xcode.
3)Goto Organizer / Provisioning Profiles / Refresh and allow Xcode to fetch the latest ones.
4)then go to project target->build settings->build options->validate product and change your release mode to yes. see the image below.
then,clean your project and generate the archive.

I had the same issue because the application archive contained files with non-ASCII characters. I renamed all of them and then it worked.
You can find all files with non-ASCII characters by executing the following command in the terminal from the archive folder path:
LC_ALL=C find . -name '*[! -~]*'

Build Settings-> Build Options: Enable Bitcode = Yes helped for me. I could see the error still, but waiting a little Xcode passed it, and continued to upload the application.

I had the same issue a couple of days ago and in the end I had to clean my distribution certificates from Keychain Access, remove and regenerate them from the developer portal. After reinstalling the certificates I was able to build and run the app on the physical device, then archiving it and sending over to the App Store.
All the steps you listed here are fine. If you can connect to a physical device and make sure your certificate is listed between brackets for the code signing settings.
I had to go through the same
frustration in order to learn that the best resource to learn how
Provisioning works is the App Distribution Guide.
Additionally, there are quite few threads on StackOverflow dealing with the same or similar issues like this one: App Submission: Invalid Binary - Invalid Signature
Good luck!

Make sure your bundle id should match with App ID and Change project edit scheme to release .
If not try this link http://stackoverflow.com/questions/5196309/ios-code-signing-fails-a-sealed-resource-is-missing-or-invalid

I have a same problem with xCode 13+, in my case i just replace the target name with not special caracter.
That fix solved my problem 99% because i have multiple targets on my project and some targets presented this problem because contained special carcters in the target name.

I did run into the same problem as this today, turned out to be a .DS_Store file in the Resource directory. Removed that file before building and then everything worked out.

I have a same problem. Then, I found the best solution to fix it.
Replace your Product Name of your App by the new name in which without Unicode Characters.
Go to [App] > Target [App] > Build Settings > Packaging > Product Name.
Fix Invalid Signature

Related

Automatic signing is unable to resolve an issue with the "myProject" target's entitlements [duplicate]

This post relates to a rapidly changing event.
I've tried all the other questions and searched everything on this that I could already, a lot of the other questions involved existing apps that were being updated or people with developer accounts but this is like my second time using Xcode and it has worked before.
This just happened out of nowhere. I keep getting these two errors and it allows me to run simulators but not build onto my iPhone:
Automatic signing is unable to resolve an issue with the "LearningSpriteKit" target's entitlements.
Automatic signing can't add the application-identifier and keychain-access-groups entitlements to your provisioning profile. Switch to manual signing and resolve the issue by downloading a matching provisioning profile from the developer website. Alternatively, to continue using automatic signing, remove these entitlements from your entitlements file and their associated functionality from your code.
Provisioning profile "iOS Team Provisioning Profile: #####.LearningSpriteKit" doesn't include the application-identifier and keychain-access-groups entitlements.
This issue is related to Bug 1534145. SSL.com: P-384 curve / ecdsa-with-SHA256 certificates.
A representative from Apple estimated 558,000 certificates to become invalidated: Bug 1533655. DigiCert: Apple: Non-compliant Serial Numbers
GoDaddy, Google, Apple and Facebook (that would explain why Facebook was glitchy today) are affected.
They are working on resolving the issue right now.
That would explain our problems, folks!
Update: The issue has been resolved. Try to refresh your projects.
Workaround: change Bundle Identifier and/or Version.
I restored a profile from Time Machine when this was working and upon launch, Xcode immediately deletes and replaces it with a new one. The key difference seems to be the old profile has the get-task-allow entitlement while the new one has NO entitlements. This is definitely broken at Apple's end.
Edit: The entitlements should also include a keychain access group, but again, no entitlements at all. Should look like:
It seems Apple broke the automatic signing system.
I was playing around with a few projects and Xcode just fetches the incorrect profile.
This worked for me:
Turn off "Automatically manage signing" in project target
Go to ~/Library⁩/⁨MobileDevice⁩/⁨Provisioning Profiles⁩
Remove previously downloaded profiles
Turn on "Automatically manage signing" again
EDIT
As per latest update Apple successfully resolved Automatically Code
Sign with Free Account issue.
I tried it and I can confirm its resolved.
Please try at your end.
Update
Tested with Latest XCode 10.2 and it's working fine + they improved
performance of overall Xcode & codesign feature.
I am also facing the same issue while I am creating a new Profile from Xcode and if I go to other projects and check over there also I am facing the same issue as below.
Due to this issue, none of my projects can build with the old profile and certificate.
The strange issue, so I checked a newly created Profile and compared with the old one, and I found that App ID is unknown as well as there were no Entitlement details in the newly created profile.
Check the below screenshots of the old and new profile comparison:
Old Profile:
New Profile:
So it means it's not able to set App Id and Entitlements in the new profile. So the end result does not work all old profiles and giving the same error in all projects.
Issue Workaround:
Step1: Go to Provisioning Profile folder (path: ~⁨Library⁩ ▸ ⁨MobileDevice⁩ ▸ ⁨Provisioning Profiles⁩).
Or use a shortcut to jump directly into this folder like CMD + Shift + G and enter ~/Library/MobileDevice/Provisioning Profiles it will redirect your finder directly on the Provisioning Profiles folder.
Step2: Sort the files inside that folder by Date Modified.
Step3: Check profile with Unknown App Id and delete all unknown profiles.
Step4: Come back on Xcode and check all old projects will work as expected.
Note: Make sure none of your project open while doing above changes.
Otherwise, it will create a new profile with Unknown App Id.
I hope this will help and Apple will solve this bug soon!
UPDATE: This solution still works as on 2019/Mar/20 7:00 UTC+0
SOLUTION: no Xcode reinstallation is required. I used a brand new free AppleId, but later checked with my old AppleID and it also works.
In Xcode, under the General tab, untick the Automatically manage signing option
Close Xcode.
Erase old profiles in ~/Library/MobileDevice/Provisioning Profiles:
cd ~/Library/MobileDevice/Provisioning\ Profiles
rm -rf *
On MacOS, run Launchpad → Other → Keychain Access and remove all certificates related to iPhone development, like the following four on the picture:
Apple Worldwide Developer Relations Certification Authority
Developer ID Certification Authority
iPhone Developer: your_name_or_email
Uninstall the old app on iPhone. Restart both iPhone and Mac
Open Xcode and change the Bundle Identifier of your app, at least one character (later you may revert this change)
Enable the Automatically manage signing option in Xcode.
After this you should be able to run and debug your app on your device.
If you have a “iPhone has denied the launch request” problem, the solution is in an answer to Stack Overflow question iOS 12 iPad Denied Launch Request - Xcode.
In short, you need in Xcode to go to menu Product → Scheme → Edit Scheme... and select Executable: ask on launch.
This issue has been resolved, BUT some people still have a problem with it. If you're one of them, try the following:
1. In the General tab of target settings - uncheck the Automatically manage signing option
2. Close Xcode (fully, not just your project)
3. Erase .mobileprovision files under ~/Library/MobileDevice/Provisioning Profiles/
4. In Keychain Access, delete the following:
iPhone Developer: youremail#email.com
Developer ID Certification Authority
Apple Worldwide Developer Relations Certification Authority 3.
5. Delete the app on your iOS devices
6. Restart your Mac and iOS devices
7. Open Xcode again
8. Change the Bundle Identifier (even if it's a single character, you'd change it back to the original after you get it going)
9. Check the Automatically manage signing option
10. Use USB to connect your iPhone/iPad.
11. Make sure you trust your certificate on your iOS devices
This should do work for you.
It seems that this problem has been resolved now and the personal accounts can resign their apps automatically again.
Regarding to #Paul answer, it is not related to uninstalling Xcode. It is fixed from the server side.
The only thing that is required is removing Apple Developer Certificate (for the personal account) from your keychain, so that Xcode retries to generate and download a new one.
Here is the solution:
Let Xcode be open.
Select your developer account and let the error appear again.
Go to the keychain app
4.a) Goto certificate section
4.b) Remove All (valid and invalids) certificates (I have three valid and many invalid!)
After removing the last certificate, macOS will recreate a new certificate for the active developer account automatically.
Run your app in your iDevice. You need to enter your system password to add newly created certificate into the Keychain.
If in the second run it says
Your iPhone has denied the launch request
Just go to:
Product → Scheme → *edit scheme: uncheck "Debug executable"
I hope it solves your problem.
I got it to work by doing the following steps:
Go to Xcode
Preferences
Accounts
Manage certificates
Plus sign
iOS Development
Done
Download manual Profiles
Close
Go to your target
Change development team to none
Change development team to your previous team
It should work.
I am finally able to deploy to our iOS devices again. Here are the steps I took to make it work.
First, I followed all 10 steps in Zameer's answer here. I have copied them below:
Open your project in XCode.
Select your project from the project navigator and then select your target from the column.
Click on the General tab and under the Signing section, make sure "Automatically manage signing" is enabled.
Click on the Capabilities tab and turn On both the "App Groups" and "Keychain Sharing" settings. This might raise an
"Automatic signing failed" popup error, just click cancel to make it go away.
This should generate a entitlements file for you named nameProject.entitlements in the project folder of your project navigator.
Move this entitlements file outside of the folder, just below your project file.
Select your target again and return to the Capabilities tab to turn Off both the "App Groups" and "Keychain Sharing"
settings. This again might raise an "Automatic signing failed" popup
error, just click cancel to make it go away.
Now select your project above the target and go to Building Settings tab.
Scroll down to the Code Signing Identity setting under the Signing header and select iOS Developer from each drop down.
Under the above Signing header, double click the text field beside the Code Signing Entitlements and enter the name of your
entitlements file, nameProject.entitlements.
After completing those 10 steps, the 2 red entitlement error messages in XCode went away and I was able to build and deploy the XCode test app to the iPhone and run it.
Although that XCode test app could build and deploy, I develop on a PC using Xamarin and I was unable to deploy my Xamarin.iOS application to my iOS devices and kept getting an error in Visual Studio: the executable was signed with invalid entitlements. I did the following things and now I can deploy my Xamarin app and run it on my iOS devices:
I deleted the provisioning profile from the Mac in the ~/Library/MobileDevice/Provisioning Profiles directory. XCode immediately generated a new provisioining profile (I'm not sure if this step was necessary but I'm just writing it because that's what I did).
I changed my Xamarin.iOS.csproj file and removed Entitlements.plist from the CodesignEntitlements element so it now just looks like <CodesignEntitlements></CodesignEntitlements>. Visual Studio automatically added two elements to the same propertygroup in the project which are probably not necessary but I thought I'd mention: <CodesignExtraArgs /> and <CodesignResourceRules />.
Maybe forum post [iOS 12 SDK] - deadline March 2019 - Legacy Mode might help.
It talks about Apple refusing to build iOS applications under SDK 12 as of March 2019 (OP from Dec 2018).
I've not yet tried this, but it may be linked to the issue. I have a free developer account and am also experiencing this bug.
Here's a screenshot in case the link changes (screenshot 1 below).
This is the link from the first screenshot (screenshot 2 below)
1
2
There is one other potential source of this error. If you do not have a valid signed development certificate setup within your Xcode environment it will throw similar errors as posted by the OP.
You can check out your development certificates status following the Apple link here.
For macOS Big Sur Beta
Archive in Xcode 11
Upload with Xcode 12 beta organizer (Window -> Organizer)
For me, it finally works again. Either they just fixed it or any of my other steps helped:
Uninstall Xcode and all related files (using AppCleaner)
Install Xcode via the App Store
Change the Bundle Identifier of the App
Remove all "iOS Developer" Keys from Keychain
Here is a temporary workaround:
Change Bundle Identifier: Target → General → Identity → Bundle Identifier (set this to a different value than it is right now)
Change Version: Target → General → Identity → Version
Disable debug executable: Product → Scheme → Edit Scheme (uncheck the box that says "debug executable")
Delete Provisioning Profiles: ~/Library/MobileDevice/Provisioning Profiles delete everything in this folder.
You now should be able to build and run projects on simulators and devices.

iOS Missing or Invalid Signature: The bundle is not signed using an Apple Submission Certificate

I have been trying to sign my iOS app for about a week now and when I attempt to submit to the app store through Xcode and through Application Loader I keep running into this error:
Application Loader
Xcode:
I am building the app with the Apache Cordova tools for Visual Studio and i have tried both building the .ipa file through visual studio under the 'release' setting and also using on the project files built by the 'remotebuild' tool on a mac to create a new Xcode project and then trying to archive and submit it to the app store that way.
In the Xcode situation, i have tried the solutions given in this question Failed to submit app to iTunes Store and i have made sure that the bundle ID of the app matches the bundle ID of the provisioning profile. When I run the validation and export tasks in the archive organizer they both work fine but i cannot get past this error despite that.
When i try to publish through visual studio, I am building the app with the 'release' setting so there is a .ipa file within the app's directories and then i'm transferring the files of my PC to my Mac with a flash drive, taking the newly created .ipa file, and submitting it through Application loader and it is giving me the same exact error. Does anyone have any idea how to verify or manually sign an app with a provisioning profile or can they recommend a fix to this bug?
EDIT:
I believe I have the correct keys in my keychain
I Resolved like this
open KeyChain Access application
Click Login in left-top Keychains section and then select Certificates from bottom-left Category section
Select "Apple Worldwide Developer Certification Authority", right click Get info
Change Trust value to "Use System Defaults"
Repeat this for "Developer ID Certification Authority" too.
I have got this issue. I have restarted xcode and tried again, then it works like a charm!
If this problem still persists, then I can Go to Keychain Access, delete all the expired certificates, and add the corresponding valid ones.
It's because the private key that is used for creating the provisioning profile is not installed to your KeyChain. I think you just download the provisioning profile directly and archive? You should ask for the private key from the person who create that certificate. And then import to your KeyChain. This error will go away.
For me, I actually had a distribution certificate that was set to "Always Trust" on Keychain Access which resulted "iOS Missing or Invalid Signature: The bundle is not signed using an Apple Submission Certificate" issue.
Once I changed back to "System Default" the problem went away.
Thanks kampai for pointing me to right way.
If you are using old Xcode (like me with xcode 11.3.1 on virtual machine), downloading intermediate apple certificate will help (you can do it at developer.apple.com when adding new cert.), then add it to your keychain by clicking on it.
I got this issue too. And resolve it by updating Dev Key and Distribution Key on KeyChain Access ( Developer give me wrong key). Then I Export Archive and Upload to Itune
Per #Kanak
For Cordova/Ionic,
Go to xCode
Workspace/Project setting
In the dropdown, select Legacy Build System
I got this issue resolved by resetting the provisioning file that is by first setting it to automatic and then manually set to appropriate settings. Then cleaned the build and rebuilt and submitted without any issue.
This can also happen if you are trying to upload and submit a build created with xcodebuild after an Xcode or OS X version update if you haven't installed the latest Xcode components on the your machine or build server (and didn't use the -runFirstLaunch parameter).

Xcode The executable was signed with invalid entitlements [duplicate]

This question already has answers here:
The executable gets signed with invalid entitlements in Xcode
(40 answers)
Closed 2 years ago.
I would install an application in my mobile phone by using Xcode but it was not installed with following an error message.
Error Message
"The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016)"
Matters of Inquiry
Why does the error message occur while I install the application?
Would you mind if you can give me the solution of this problem?
Check if you are using Entitlement file in Build Setting > Code Signing Section.
If yes, try deleting that file name.
You are using Entitlement file
The entitlements file defines certain capabilities of your app. Usually, the file is automatically generated by Xcode when you enable a capability for your app. You only need the file if you enable certain capabilities, e.g. Healthkit integration. If you'd like to use these features, you have to add it. Otherwise, Apple will reject your app.
To fix this
Go to the build settings of your target.
Make sure that you have "All" selected instead of "Basic"
Type "entitlements" into the search box
The result is the build setting where you can specify where your
entitlements file is located
Remove them
You are using the wrong Provisioning Profile
A provisioning profile is a collection of digital entities that uniquely ties developers and devices to an authorized iPhone Development Team and enables a device to be used for testing. A Development Provisioning Profile must be installed on each device on which you wish to run your application code.
Go to Build Settings > Code Signing > Provisioning Profile
Select a development profile under Team
Please ensure that the Team in the project, target and tests are the same.
Bundle Identifier and App ID do not match
Go to the build settings of your target
Select Packaging and change your App ID to match the Bundle ID
Clear cache in Xcode
Command-Option-Shift-K to clean out the build folder. Even better, quit Xcode and clean out ~/Library/Developer/Xcode/DerivedData manually.
You are using wrong provisioning profile to build your app on devices make sure you are using right type of profile. I was using App Store Deployment profile to build on devices. Use ad-hoc profiles or development profiles to build on your devices.
You are using the wrong Provisioning Profile i.e. Distribution for development. Go to Build Settings > Code Signing > Provisioning Profile and select a development profile.
Check the if your "Code Signing" configurations are same on "PROJECT>Build Settings" and "TARGETS>Build Settings".
Personnally, I use for both:
- "Code Signing identity": iOS Developer
- "Provisioning Profile" : Automatic
Check your "Team" parameter at your targets. It should be the same for your project and tests.
For me none of the above answers worked. I tried to remove every code signing certificate from Keychain and build the app. When I resolved all code signing related errors for my target I still had some of them in Tests target. It has been set by someone else from my team before. I just switched to iOS Developer, and the invalid entitlement error went away.
I was getting this problem after moving app from one account to another. I tried all the solutions given by others, those might be correct in other cases. But I fixed the problem by going File -> Workspace Settings -> Build System and choosing "Legacy Build System". I'm using XCode 10.3.
I faced this problem and my problem was My Bundle Identifier and AppID was not matched. Please change your Bundle Identifier in Build Settings->Packaging like your AppID.
Just goto Apple developer portal from where you have downloaded provisioning profile.
Select your profile click edit and check whether all certificates are selected or not.
In my case selecting all certificates and downloading that new profile solved the above mentioned issue.
Also make sure in your schema you have set "Build configuration" to the correct configuration, in most cases "Debug".
I got this error when export the ipa with App Store provisioning wrongly during CI process. My intention was to export with Adhoc provisioning.
I had the same error. My problem was that I checked 'Enable HealthKit' in Entitlements.plist, but I did not enable HealthKit when I created the App Id.
In short, all entitlements in your app (Entitlements.plist file in your project) should be configured on the provisioning profile you use (Provisioning profile = app ID + certificate + information about devices your app can run on).
Had the same problem that suddenly popped up in my project from one day to the next.
What fixed it for me was turning "Automatically manage signing" off and on again for both targets and making sure the right development team was selected once it was on again (defaults to none in my project).
It could seems a easy solution but I solved updating my iPhone's iOS version.
All answers I have seen talk only about xcode update. It was strange because my old iOS version was iOS 13.3.3 and it worked on another iPhone with iOS 13.6. After updating to iOS 13.7 it worked.

App Submission: Invalid Binary - Invalid Signature

I am trying to submit an update to the iOS app store. I am going from a Buzztouch app to a Sprite Kit app. I am able to archive the Xcode project and submit it. The app gets to the status of Upload Received but than about a minute later, it changes to Invalid Binary and I get an email saying:
Invalid Signature - Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target.
Once these issues have been corrected, go to the Version Details page and click "Ready to Upload Binary." Continue through the submission process until the app status is "Waiting for Upload." You can then deliver the corrected binary.
I have cleaned out the build directory, rebuilt my release target, and made new provisioning profiles multiple times. All of the Code Signing Identities are set to iOS Developer. Code signing and the provisioning profiles have always been a little bit confusing to me, I could have made some obvious mistakes.
I have tried submitting over 50 times! I find this very frustrating because I have emailed Apple and they got back to me but it was just a link to the dev center with code signing information. I have also spent lots of time searching the Internet to find a solution to this and there hasn’t been a good solution that actually works for this problem.
The only thing I can think of is either because I am changing from a Buzztouch app or it is Sprite Kit.
Here is a screenshot of my code signing:
In Apple developer support there are two additional common causes of the Invalid Signature binary rejection reason,
executable files containing special characters (i.e. non-numeric, and non-alpha). To resolve this issue, change the Xcode target’s Product Name build setting from “${TARGET_NAME} to a string containing only alpha/numeric characters. Let me know if this was the cause of the issue (and the problematic characters) because I file bug reports to fix each instance I find here.
Apple Double Files ("double files") that result from copying the Xcode project uncompressed to/from a non HFS+ formatted hard drive. To check if this caused your rejection: 
A. Run the app diagnostic here: How do I check if my application's signature has been corrupted?
B. Then check the command line output with: List of Signature Verification Failure Root Causes. Double files are diagnosed with a message like:  
resource missing: my.app/._.*
C. From the docs:
The file prefixed with "._" is considered an AppleDouble file and it
can result from copying the uncompressed Xcode project folder onto a
non-HFS+ formatted disk. The AppleDouble files must be removed using
the 'dot_clean' command. The Xcode project folder is the argument to
dot_clean as illustrated below. Note: You can drag your Xcode project
folder from Finder into the Terminal window to automatically fill its
path into the command.
dot_clean /path/to/My_Xcode_Project
(If Terminal can't find the dot_clean utility, download the optional Command Line Tools through Xcode > Preferences > Downloads)
D. After running dot_clean on your Xcode project, create a new app archive (via Xcode > Product > Archive), reattempt submission.
To prevent double files be sure to compress the Xcode project folder to .zip using Finder before transferring it to/from a non HFS+ formatted hard drive. 
This is what I did when I encountered a similar problem with the Mac App Store:
Re-generate the app's Distribution and Development certificates (from the Apple Developer's Certificates site).
Download both certificates and drag them to Xcode's icon (not sure whether it had any impact, but after so many submission failures, I was pretty superstitious).
Re-fresh the certificates and identities from Xcode.
Open Xcode's Preferences.
Go to Accounts tab.
Clicked my account
Clicked the refresh button.
Generate the archive.
Submit the app and clicked on "refresh signing identities" somewhere mid-way in wizard prompts.
As a reference, here is my built settings related to signing. That one worked the last time I submitted the app (which has been in the "waiting for review" state for the past two days now, so I guess it passed all of their automated tests).
Your issue relate with signing failed because of your app didn't sign with recent distribution certificate. Check the following steps:
1) Check your bundle identifier to list out provisioning profile as like below picture. Because It also lead to this problem.
2)You may not using the correct certificates when building your app. Just Delete your certificates in Provisioning Portal and create new ones and update them in Xcode.
3) From your picture, you didn't selected correct provisioning profile. Goto Organizer / Provisioning Profiles / Refresh and allow Xcode to fetch the latest ones. see screen shot to how to do that.
Select correct Provisioning profile.
Select correct code sign.
4) Cleaned up your project.
5) Just clean all your targets . You can even go to /Users/%USERNAME%/Library/Developer/Xcode/DerivedData and delete all of the directories in there.
see this ref
Under "Code Signing Identity" Make sure you have selected your Distribution Cert for the "Release" scheme
Under "Provisioning Profile" make sure you select a Distribution provisioning profile (not an Ad Hoc one)
Archive and distribute, make sure the same cert is selected when submitting (after entering your iTunesConnect info)
After doing all of the above
Menu Bar
try Product->Archive
Then from the organise try resigning and submitting.
Window->Organiser
Select archive and then press distribute (but i'm pretty sure you'll know how that works)
Obviously if you can't do this then chances are you have indeed got something wrong with your signing certificates, more specifically your bundle identifier is likely to be the culprit.
One other option is your app uses services that you haven't set up on developer.apple.com/ios for the app id such as game centre, push notification etc. Good luck
check your launch images . Are they conflicting like 2 images have got same name. Because i have got the similar issue which i solved like this within 10 minutes.
To figure out this problem I just created a new Xcode project and copied and pasted everything into the new project.
In my case the problem was to not ASCII chars in filename (someone did sent us to embed), solution was to do a global search in project:
ls -1 -R -i | grep -a "[^A-Za-z0-9_.':# /-]"
And delete those chars from filenames.

Code Sign error: No unexpired provisioning profiles found that contain any of the keychain's signing certificates

I think I've reached the nadir of iOS provisioning hell. After migrating to a new mac and doing an archive for distribution, I received the error:
Code Sign error: No unexpired provisioning profiles found that contain
any of the keychain's signing certificates
I then erased all certs and keys and provision profiles and did a "hard reset" (deleting all keys, certs, and profiles), following Apple's instructions by hand, with the same error. Then I did another hard reset and then had Xcode handle the whole thing via the Organizer, did another archive - only to see the same error.
I have all certs (WDRCA, Developer ID Cert Authority, iPhone Dev, iPhone Distribution) showing in Keychain Access, Xcode shows that it sees the dev and distribution certs, as well as the provisioning profiles, all marked with a green checkmark and "valid" status.
Code signing within the app show the correct dev and distribution is selected.
What's really troubling is that a Google search on the error shows one tech note from Apple that isn't very helpful, 2 tweets, and 3 results in Japanese - and nothing else. I contacted one of the tweeps and he said he fixed it with a hard result, which I have done twice.
Any ideas on where to go or what to do next?
Fixed it by Organizer -> Teams (select Your Team) -> Refresh (low right corner).
After removing all devices/profiles/certificates and adding/creating it did still not work here too....also removing the Xcode prefs did not help.
but it seems to in the project settings, check in the build settings under CODE_SIGN_IDENTITIY, in my project the first line was set to a old profile but not visible in the list, only if you open the pulldown, after removing that it worked.
I just had this problem as well. I finally realized that the identifier is case sensitive. For example if your product name is "StackOverflow" it automatically tags the identifier with com.yourcompanyname.StackOverflow. (this of course can be changed by going to the summary of the target). The problem lies in what the app id is in the developer portal. Make sure that the identifier in the portal matches what's in Xcode.
I have the same issue here since Xcode 4.3 install (moving from /Developer to /Applications). I found this post for changing the Xcode dir
in the terminal check what path it is set to with:
/usr/bin/xcode-select -print-path
and then if it is still set to /Developer set it to /Applications:
sudo /usr/bin/xcode-select -switch /Applications
which worked for me to be able to do the update to 4.3.2 but this did not resolve the issue mentioned....so maybe it helps you.
After nine hours of hair pulling, cursing and burying my head in my hands... All I had to do was create a new project, transfer the files over by hand, and the error went away. Argh.
Update: My marking my own answer as correct does not mean these other answers were wrong - I didn't get a chance to try any of them.
i 've met the same problem.
the answer of the problem is simple.
you need to login your apple develpoer web site
to apply and download a profile for your app .
after double-click the download file ,
you can see the file in organization of the project in xcode .
the name of the bundle id is the type like com.yourname.appname
the xcode device choose the ios device
and the codesign of the target should choose distribution
which is one of the file in organization of the project in xcode .
f.y.i.
A few days ago I had exactly the same problem.
The issue is related to no having the correct distribution provisioning profiles; My error was that I added a new device to the portal and did not re-download the distribution profile from the developer site.
Today I had the same issue; while it was working perfectly with the developer profile i could not archive or build a distribution package..
I had to go to the portal and manually re-download my distribution profile because new hardware was added even though I am not actively using it on the developer profile (did not check the box to add it to the provision)
Hope it helps anyone
I went straight to "but it seems to in the project settings, check in the build settings under CODE_SIGN_IDENTITIY, in my project the first line was set to a old profile but not visible in the list, only if you open the pulldown, after removing that it worked."
And that seems to have done the trick.
I fixed it by updating the bundle identifier in the project settings > targets > appName
in the info tab.
I had this problem, and fixed it by putting my scheme back to Debug, as opposed to Release.
I faced the same problem after upgrading to Xcode 4.3.2 and SDK 5.1. Everything worked perfectly in the previously version of Xcode with SDK 5.0. After many hours of hair pulling I created a new distribution certificate in the iOS Provisioning Portal->Provisioning-> Distribution Tab and after downloading it and installing it into Xcode (drag-and-drop) it works to archive after selecting the new certificate in the Code Signing area for my target.
I had the same problem after upgrading the OS/xcode so its worth to try.
the solution for me was simple,
go to the ios provisioning portal.
make sure the app certificate for the app is valid and not expired.
download again it again and double click it to install.
it should fix the problem.
I had this error when trying to build a release version - no problem occurred for debug builds. Baffling because in the code signing section of the build settings I had the same profile selected.
The solution for me was to create and download a new distribution provisioning profile, even though from the settings it appears not to be used.
I found a solution that was not on here, after looking through the errors and looking into my raw .app file, i found the solution.
Go to your target, and then "Build Phases" instead of Build Settings.
Make sure that in "Compile Sources" is your storyboard. For some reason Xcode didn't add the storyboard to this area of my file when I coppied the storyboard in.
P.S. I had to add the other .m's that i wanted in the project to this area as well (the ones that I dragged in, not created in the project)
Hope this helps
In the Target settings, in Sumary, check if Bundle Identifier is exactly the same as in itunesconnect.com
as example:
Bundle ID: com.mycompany.myapplication
I fixed mine by Analysing instead and checking that error. It indicated that my bundle ID was not lowercase as in the provisioning profile.
I actually was having this issue but whenever I tried to get into the organiser it caused XCode to crash. To resolve this issue I went into my targets and changed everything under Code Signing Identity to iPhone Developer. The target defaulted to the provisioning profile I wanted and it worked.
What worked for me is to choose "Don't code sign" and then do a build. This generates an error, but seems to clear out whatever xcode is hanging on to. Then choose the right provisioning profile and build. This has solved similar problems for me in the past.
Fixed it.
Went to Project-> general-> found an option "no provisioning profiles found" Fix Issue button. Clicked it . Automatically fixed
Reason Of Error
If you don't have any valid provisioning profile downloaded to your system's Library/MobileDevice/Provisioning Profiles folder then you might run into this error.
Solution
Login to your Apple Developer Account from Xcode->Preferences->Accounts and then download a valid provisioning profile.
Move to Target->General and select the correct Team.
Now go to Project Build Settings->Code Signing Identity and select just 'iOS Developer' and 'Automatic' in Provisioning Profiles. Your app will run smoothly.
In the Build Settings look for
General > Identity > Bundle Identifier and Team Settings. Fill in the Bundle Identifier and select Team. (this basically your publishing info). Of course as the others have written you'll need the correct dev or team account. This solution worked for me and resolved the build error.
Its because of the SUDO permission you have given while adding the platform.
Follow this link Ionic Code Sign error: No unexpired provisioning profiles

Resources