Codesign error while archiving IOS app - ios

I am new to IOS. I have developed an IOS application now i want to publish this application on iTunes. I have created Certificate, App ID and then Provisional profile. I have succesfully added this in “Code Signing” section of "Build Setting”. Now, while Archiving the project i am getting a following error.
error: Couldn't codesign /Users/dx/Library/Developer/Xcode/DerivedData/xxxx-dgsqnqppikhtqeezizlbydrpxfiz/Build/Intermediates/ArchiveIntermediates/xxxx/InstallationBuildProductsLocation/Applications/xxxx.app/Frameworks/libswiftCore.dylib: codesign failed with exit code 1*
Please help me out of this problem. Thanks in advance.

You need to re-generate your provisioning profile from Apple Developer Center. As far as I know they add something new to profiles and that causes the problem.
Solution
In keychain access, -> Show Expired Certificates, then in your login keychain click on expired certificate and delete it. I also had the same expired certificate in my System keychain, so I deleted it from there too.
-> After deleting the expired cert from the login and System keychains,download certificate from below link and open with keychain.
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer and add it to Keychain access > certificates (which expires on 2023)

Related

Profile doesn't include certificate

Using Xcode 9.1, after building an iOS app, I try to archive it.
But I get the following error message:
Provisioning profile "MyAppProfile" doesn't include signing
certificate "iPhone Developer: My Name (X1YZ2AB3CD)".
What is the simplest way to solve this?
Open key chain in your mac and check your development certificate...I think your certificate is expired using which you have created your Provisioning profile..thats why it is showing "MyAppProfile" doesn't include signing certificate.
1.To solve this issue go to your developer account and download the latest development certificate and add it to keychain and remove all expired certificates from keychain.
Or
2.This issue also comes when you have multiple developer accounts in your keychain and the expired developer certificate name is same as that of active developer certificate. After removing the expired certificates, you must restart Xcode to let it reload the remaining certificates.
Try enabling automatic signing. It will take care these things mostly.
The reason for this error is you may have chosen a developer certificate(which the provisioning profile doesn't intended to use with) for distributing/release build.
I have just encountered the same problem. What fixed it for me is to go to the xcodeproj file>Select the correct build target>Build settings>Code signing identity>select the correct identity for the build configuration (If you didn't change it in the edit scheme screen, it would be "Release" for archiving).

Problems with iOS Free Provisioning Profile

I've been using Xcode with a free Apple ID, and signing a App with a free provisioning profile.
However, after I signed the App with another Mac, the certificate on the first Mac I used to sign the App with does not work anymore.
I received this error message when I tried to run it on my iPhone:
Please verify that your device's clock is properly set, and that your signing certificate is not expired. (0xE8008018).
After generating a new certificate via Xcode > Preferences > View Details... > iOS Distribution > Create, I got this error instead:
The identity used to sign the executable is no longer valid.
After deleting the App from my iPhone, I tried to run the App again and received this error message instead. This also caused my phone to freeze for a while:
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /var/mobile/Containers/Bundle/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Test.app/Test
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Test.app/Frameworks/libswiftCore.dylib: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Test.app/Frameworks/libswiftCore.dylib'
(lldb)
Update: I'm using Free Provisioning Profile, thus I don't have access to iTunes Connect. I also can't import the certificate from my 2nd Mac as it was it was reset.
Update 2: I've also visited Keychain App and found 2 certificates - one expired and one valid. I deleted the expired one and tried to run the App on my phone again, but the error persists.
Update 3: I've tried to revoke all my certificates in developer.apple.com, but there isn't a certificates management. Only 'Programs & Add-ons' and 'Your Account' sections are available in the nav, which allows me to enrol into Apple Developer Program.
Update 4: I've also restarted my Xcode to no avail.
The main problem is that I'm not sure why I cannot revoke and regenerate a new certificate.
How can I solve this problem?
Generate a New CSR from your Keychain and download new certificate using this CSR. Include this certificate in your provisional profile and download it. Make sure you remove all expired certificates from Keychain. Good luck.
You don't need iTunes Connect to manage your certificates, IDs and provisioning profiles. iTunes Connect is used for managing your app store releases, which as you know you can't do with a free account.
You need to go to developer.apple.com and log in with your free account to the member center. You will be able to see the certificates and provisioning profiles under your developer account.
Since you don't have anything in the store (you can't with a free account), I would go into the developer's member center, revoke and delete any certificates that are out there, and delete all provisioning profiles. Start from scratch and generate a new certificate using a brand new CSR. Then generate a new provisioning profile using the existing app ID and the newly created certificate. Download the profile update your project settings to use the new signing identity and profile, and you're back in business.
Also, this is assuming that you are not sharing this developer account. If you are, doing the above instructions will make it so other developers will not be able to build with the signing identity unless you give them the private key for the certificate.
I managed to fix this problem by renaming the App name, and recompiling the App. I think that by renaming the App, a new certificate is generated, thus it would work.
Even though, it's not really a great solution, but it solved my problem as I wanted to rename the App in the first place.
Thanks everyone for providing answers!
I had to create a new Apple ID and it worked. Not the ideal solution but without access to certificates its the only solution that worked for me.

Unable to install the testflight build with "Developer certificate is no longer Valid" message

I am facing a weird situation, the appstore upload were successful and were able to install the testflight build till yesterday. However since today it is showing "The app couldn't be installed because developer certificate is no longer valid". We have uploaded other projects yesterday with the same certificate. We tried regenerating the profile , but still the app cannot be installed from testflight and the weirdest situation is some users were able to install the app from testflight . Have anyone faced this situation? Is there a solution?
Yes i have faced same issue like you,
I turned off all the beta testings and then turn on the one which i want to test, and then it works.
Note:- Beta testing iTunesConnect - App
Try this.
Apple made certificate revoked,just delete certificate in your key-chain and download it again.
Maybe you have noticed that all your certificates in your Keychain show the error "This certificate has an invalid issuer".
To fix it follow these steps:
Open up Keychain Access.
Show expired certificates by going to View > Show Expired Certificates.
Navigate to the System keychain and delete the expired WWDR Certificate.
Download the new WWDR Certificate here and import it into your keychain.
In keychain access, -> Show Expired Certificates, then in your login keychain click on expired certificate and delete it. I also had the same expired certificate in my System keychain, so I deleted it from there too.
-> After deleting the expired cert from the login and System keychains,download certificate from below link and open with keychain.
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer and add it to Keychain access > certificates (which expires on 2023)
After this try to create new developer certificate and after this you can upload app for testing and this error will solved.
It worked for me.

This certificate has an invalid issuer in ios keychain

Keychain show the certificate error > This certificate has an invalid issuer
See the screen shot.
RefLink> This certificate has an invalid issuer keychain
Also I have implemented the above url solution and ipa is created but at the time of uploading the build from Application Loader its show the error as per the screen shot.
Please help anyone.
Download https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
and double-click to install to Keychain.
Select "View" -> "Show Expired Certificates" in Keychain app.
Remove Apple Worldwide Developer Relations Certificate Authority certificates from "login" tab and "System" tab in Keychain app.
Ensure the new downloaded cert is in both login and system Default to only system tab will still give error.**
Delete all your certificates and provisioning profile on developer portal.
Create certificate signing request from keychain.
Recreate all the certificate & provisioning profile using the CSR generated in step -5
Download and install those certificates created on step-6 and try.
Try to install new certificate from link below.
https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
This worked for me. I hope this will help you.
After this create and install new iOS Distribution and iOS Development Certificate.

Redownloading iOS development certificates

I was getting a 'Valid signing identity not found' warning on my provisioning profile in xcode, so I kind of got lost and ended up deleting my certificates.
The certificates are still on the portal, but when I download the .cer file it still presents the same valid signing error. When i check in Keychain access, the certificate is there, but its in 'Certificates' and has no drop down menu with the key icon and name
Im very confused.
Within Keychain access - is my certificate supposed to appear in 'My Certificates' or 'Certificates'
From my position, how would I go about re-installing this certificate? From this tutorial his certificate is in 'My Certificates' not 'Certificates' and has a dropdown with his name. Why dont I have this? Is this what I should have? I've read multiple guides on how to install these certificates but nothing seems to be working.
Login to Apple Developer Portal, regenerate the certificate if needed and donwload it again (you can use the certificate signing request you've used in the past (.csr file uploaded in order to generate the certificate)).
Any provisioning profiles with that certificate should be regenerated and downloaded again.
If you are using Xcode 5, you can try going to the Xcode Menu > Preferences > Accounts > View Details and then click on the "+" button.

Resources