APNS certificate expiry issue for Hybrid application - apple-push-notifications

Got the APNS certificate for my Hybrid app (using Mobilefirst) generated yesterday. The expiry date for the certificate is 12 July 2016. But when I try to build the app using Mobile first application am getting an error saying "The APNS certificate expired on Oct 31, 2014 18:49." The certificate name is apns-certificate-production.p12
I tried recreating the environment, clearing the cache etc.. but of no help
Any help regarding solving this issue is appreciable.

I have generated my p.12 the following way and I do not encounter this error:
After creating the certificate in the Apple Developer site, I downloaded the .cer file
"Installed" the .cer file by double-clicking it, and have it added to my Keychain.
Expended the certificate in Keychain and selected both it and the private key in it
Exported and provided a password for it
Copied the .p12 file into myProject\apps\myApp folder
In application-descriptor.xml added the pushSender child element for the iPhone element with the certificate password as its value
Run As > Run on MobileFirst Development Server
The build has passed.

Related

Unable to test Flutter app on iPhone due to certificate issue

I built a Flutter app using Android Studio. Works fine on iPhone simulator.
When I go to test on my iPhone however by opening up workspace on Xcode and running it with my iPhone connected to my laptop, I get this error:
The certificate used to sign "Runner" has either expired or has been revoked. An updated certificate is required to sign and install the application.
I'm at a loss at what to do here. I am using a free apple developer account.
Any help appreciated!
You need a new certificate (development certificate) installed on your mac's keychain.
First go to the the apple developer console, then Certificates, Identifiers & Profiles => Certificates => Add Certificate (Plus Button) => Apple Developer Certificate.
In order to generate a new certificate you will need to export a new certificate request from your Mac's Keychain Assistant, in order to be able to sign new applications.
To do this: Go to the Keychain Assistant App => Keychain Access => Certificate Assistant => Request a Certificate from a Certificate Authority.
Go through the steps to generate this new certificate request and Save it to your Desktop.
Go back to your Browser, where you are trying to create a developer certificate through the Apple Portal, and upload the generated Certificate Request file.
A new certificate will be created, then download this certificate, and click on the downloaded file, and your MacOS (Depending on any Security Policy) will ask you to type your password to add the new certificate to your keychain.
This certificate will now be used by your Mac to sign all developer applications.
Please note that for production, you will also need another certificate (depending on whether you are uploading to the App Store or distributing via AdHoc).
Once you've done all this, go to the App's Provisioning profile on your Mac Account (via your Browser), then select your provisioning profile of your app, then click Edit. There should be a certificates section, please choose all of them to sign your app.
After this is all done, go to Xcode, then Manually download the provisioning profiles to your device => Clean => Rebuild => Deploy via Flutter. Please also make sure to remove any revoked (expired) certificates from your keychain (to clean up the memory bank).

"Warning: unable to build chain to self-signed root for signer" warning in Xcode 9.2

I'm attempting to migrate an Xcode project to another computer. It gives me the warning "Warning: unable to build chain to self-signed root for signer" and when it runs it crashes immediately similarly to what is shown in this Stack Overflow:
App working on simulator but not on iPhone( dyld`__abort_with_payload dyld`_dyld_start)
My issue seems similar to what is described on the Apple Developer Forums here:
https://forums.developer.apple.com/thread/86161
and similar to what is described on this Stack Overflow:
Xcode ios app development code signing
except the suggestions of deleting certificates and re-adding them, re-adding my account and restarting didn't seem to help. I have removed my developer cert for the second time and now I don't see it coming back, and I'm at a loss of knowing how to get it back since my dev portal doesn't appear to have a place to download it like it used to.
I've also tried deleting the derived data folder several times.
e: I've determined ANY project on this computer results in the same crash and warning.
If none of the other solutions work, try adding the intermediate signing certificates to your system keychain. I found this while trying to manually create provisioning profile/certificates as nothing else was working - from the Create a New Certificate step of the New Provisioning Profile process on Apple Developer platform:
To use your certificates, you must have the intermediate signing certificate in your system keychain. This is automatically installed by Xcode. However, if you need to reinstall the intermediate signing certificate click the link below:
Worldwide Developer Relations Certificate Authority (Expiring 02/07/2023)
Worldwide Developer Relations Certificate Authority (Expiring 02/20/2030)
After downloading these two files and double-clicking them to automatically add to the system keychain, the automatic provisioning profile in xcode started working (I didn't need to complete the manual provisioning profile process, but that's where I found the links)
I had the same problem and fixed with below steps:
Open Keychain Access
Select login, and click Certificates
Double click Apple Worldwide Developer Relations Certificate Authority
Expand the trust section, then next to "When using this certificate", change the setting from "Always Trust" to "Use System Defaults"
Clean the build folder and run
In my case the error was only resolved after I deleted Apple Worldwide Developer Relations Certification Authority which expires in 2023 from both System and login keychains and imported the other certificate that is valid until 2030. It seems that codesign was picking the incorrect one when both were present in the keychain.
I could fix the issue by downloading a new certificate from here and installing it.
Look at https://developer.apple.com/de/support/expiration/ for more detail.
I have been facing same issue for days now. Finally i solved it by just changing my root CA from Key Chain Access.
View in System/ Login key chains. which certificate authority is being used as signer for your personal provisioning profile's certificate. Enter a valid CA certificate and you are good to go!
Hope it helps.
Ciao!
#waaheeda's answer led me in the right direction to fix this.
I have a keychain in my repo which is used for signing on my CI. After renewing my iOS enterprise distribution certificate and provisioning profile and updating the keychain accordingly, my CI signing stopped working. Code signing worked locally on my own machine.
I suddenly stumbled upon this and found this part particular interesting:
Enterprise iOS Distribution Certificates generated after September 2, 2020 require the new intermediate certificate installed on any machines that will be code signing.
I therefore found the "Apple Worldwide Developer Relations Intermediate Certificate Expiration" in my local "login" keychain in Keychain Access and added it to the keychain in my repo, and it seems to have fixed the signing for now (and hopefully until 2030):
This is too late to answer , but if anybody still looking for solution on this thread --
this happens if you are installing certificate for the first time or installing certificate which is created on another machine
In your Xcode project go to signing capabilities enter correct bundle identifier, disable automatic signing , select appropriate profile / import / download profile
then you will find trust repair option below profile , tap on it tap on trust enter your login credentials
this will create and install following certificates
1.change the certificate trust: "Always Trust" ==> "Use System Defaults"
2.change "codesign" command ==> "sudo codesign" command
3.change the "Apple Worldwide Developer Relations Certificate Authority" certificate in login and system items trust: "Always Trust" ==> "Use System Defaults"
worked for me when use codesign command in command line
In the machine where you created the certificate
Open keychain
Look for "Apple Worldwide Developer Relations Certificate Authority"
Look at the column "Expires" and check apple.com/CertificateAuthority to see which has the same expiration
G1 Expiring 02/07/2023
G2 Expiring 05/06/2029
G3 Expiring 02/20/2030
In your ci
Install this certificate to your system keychain
a. via fastlane
import_certificate(
certificate_path: "~/Downloads/AppleWWDRCAG3.cer"
)
b. via cli
sudo security import ~/Downloads/AppleWWDRCAG3.cer \
-k /Library/Keychains/System.keychain \
-T /usr/bin/codesign \
-T /usr/bin/security \
-T /usr/bin/productbuild
In my case I had an automatically signed project and my own developer certificate was not trusted (anymore) which was apparent in Keychain > login > certificates. On my own certificate I put Always trust in the Get Info popup.
After that I had to select again the "Automatically manage signing" in the Signing & Capabilities tab, which gave an error like "Repair trust settings". After clicking that it fixed the trust of my developer CA.
Also when it was again broken after this, I copied the G3 Apple Worldwide Developer Relations CA from the login keychain (default keychain) to the System Keychain (System).
1.open xcode-> Preferences-> Accounts
2.select you appleid and click on Manage Certificates
3.click + (Add) and select Apple Development
Clean Build Folder and run project
none of those actually worked for me. I had to delete the derived data; link, remove all the certificates and reinstall them, clean cache and had to reinstall pod files. After messing around for few hours I found a proper solution.
On Xcode 13.1 and received this error when attempting to archive my app, despite it building fine on the simulator. I didn’t have to change anything with my certificates in the keychain, just cleaning the build folder worked for me.
Open “Product” menu
Select “Clean Build Folder”
Build / Archive your app
I’ve seen some other answers reference which certificates they’ve had, so I’ll just add that I also have the 2030 “Apple Worldwide Developer Relations Certification Authority” cert and the old one is still in my keychain as well, which I’ll probably need to delete at some point.
In addition to the other answers, make sure that if you are sudoed to root, exit out before you try to codesign, so that you are signing as the login user. My codesign was failing when I forgot that I was running as root.
It work for me:
macbook air,m1 2020
delete old root CA(if existed): Apple Worldwide Developer Relations Certification Authority
reinstall root CA from certificateauthority,and double click to intall.
reinstall yourself cer. example: Apple Development: XXX Tang (9DHXXX87D)

Cannot import certificate into keychain

I am trying to deploy an iOS app to a device. There are two members in my team with developer enrollments.
My team member created a certificate from another mac and exported it. I then imported the certificate into my keychain app. The keychain app is showing the certificate but in Xcode organizer when I refresh from my own developer account xcode says Valid signing identity not found
Xcode version : 4.6.3
check these steps:
export p.12 file from certificate in first mac.
set password to file. (iv'e sometimes seen issues raised when password is not set)
open p.12 file in second mac.
type in password.
download and open appropriate provision file.
Did you try import from another mac and export team in organizer? I had such problems before but i can't remember truely. Your team is valid with green mark in Teams section in organizer?

Error when trying to upload app to itunes

So I have xcode 3 and I'm trying to upload an app to the itunes through the application loader. I've already done this multiple times before but I had to renew my itunes connect account and it messed all my certificates up. These are the errors I get.
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate.
Unable to extract codesigning entitlements from your application. Please make sure "App name" is a valid Mach executable that's properly codesigned.
Now I made sure all the certificates/provisioning profiles/Bundle Ids where correct. I also made sure there where no spaces in the name of the compressed file. And that the codesigning was selected as distribution under the project and target.
What the heck is wrong?
thanks
p.s. Dont tell me I need a new computer and a new xcode...... i know
It sounds to me that the the Apple Certificate you first download to sign all your other certificates has been corrupted. I would start by deleting all the certs from the Keychain, and then downloading the Apple WW Certificate again, then create your certificates and sign them, and finally create your distribution profile.

MAS: Code Signing Identity Private Key

I've removed all development and installer certificates from the development portal, created a new CSR and generated new Application and Installer certificates.
Now I'm about to distribute the App to the MAS and am constantly presented with this error:
"Name" is a valid identity. However, the private key for the associated package
identity "Name" is not installed on this Mac.
Developer Profiles from a different Mac can be imported.
This puzzles me, since the private key is on the System, how else could I've generated the certificates without them?
Double check you have removed all old certs, there is a menu item in the KeyChain app to show all expired certs. I threw away all expired certs and things started working.
Got it working:
Created a new user account on my Mac
Cloned the repo there
Removed all Provisioning Profiles and Certificates from the Dev Portal
Let Xcode generate all the Certificates for you
Upload works!
The problem is Mac Installer Distribution certificate.
The easiest way to have everything fixed and loose all the troubles just go to Xcode->Window->Organizer->Devices and then on the lower right corner press on Refresh and log in with your account... xcode will generate and download all the certificates and provisioning profiles needed.
I followed the instructions and deleted all expired certificates from the keychain and refreshed the profiles list within the organizer. How ever the error only vanished after I restarted Xcode.

Resources