4

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?

Panda
  • 6,955
  • 6
  • 40
  • 55

4 Answers4

2

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.

Maulik Bhuptani
  • 597
  • 3
  • 14
  • Thanks, there's a revoked and a valid certificate, I deleted the revoked certificate, but the error still persists – Panda Mar 06 '16 at 13:33
  • If you are using another mac, you have to create a new certificate for that mac in itunes connect. So create a new CSR in that mac and make a new certificate as well. 1 certificate can only be used with only 1 mac. Repeat the same process after performing above steps. It will definitely work. – Maulik Bhuptani Mar 06 '16 at 13:44
  • Thanks, but I'm using free provisioning profile, this I don't have access to iTunes Connect – Panda Mar 06 '16 at 13:44
  • Then you have to import developer profile from your previous mac and you will have to google for how to do that. Sorry to say that. – Maulik Bhuptani Mar 06 '16 at 13:47
2

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.

wottle
  • 13,095
  • 4
  • 27
  • 68
  • Thanks, but there's isn't a section to see all certificates, there's only 'Programs & Add-ons' and 'Your Account', which only allows me to enrol into the Apple Developer Program – Panda Mar 07 '16 at 04:02
  • OK, I thought free accounts could still manage their certs and profiles, but I guess with free accounts, you must just use XCode to manage everything. When you go into the Xcode preferences -> Account and click the "View Details" button, do you see any valid signing identities for iOS Development: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/Art/2_viewdetails_2x.png? Have you gone through this document? https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html? – wottle Mar 07 '16 at 12:28
  • Yup, it's valid, the `Create` button is disabled – Panda Mar 07 '16 at 12:29
  • For your valid certificate in the Keychain, is there a disclosure triangle next to the certificate that allows you to expand it and see the private key for the cert? https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/Art/12_keychaincerts2_2x.png – wottle Mar 07 '16 at 12:34
  • Also, have you restarted Xcode since you deleted the expired cert? – wottle Mar 07 '16 at 12:37
  • Thanks, I've restarted my Xcode, but it still doesn't work – Panda Mar 07 '16 at 15:07
  • 1
    Looking at Apple's documentation, given that you don't have access to manually manage your certs and profiles on the site, I would try deleting the private key for your certificate, and then you should get a "Reset" button next to the iOS Developer profile in settings. This will revoke any certs and create a new one with a new private key. – wottle Mar 07 '16 at 15:27
  • I made it work by renaming the App; it will automatically generate a new certificate, thanks anyway! – Panda Mar 07 '16 at 15:50
  • Interesting. Typically you have one certificate / signing identity, but multiple profiles for each app. I don't have a free account, so maybe those accounts manage things differently. For my account, I can only have two valid certs of each type at any given time. Glad it's working now. – wottle Mar 07 '16 at 19:29
  • Yup, using a free account is quite tedious, glad that it's fixed now, thanks for your suggestions :) – Panda Mar 08 '16 at 00:44
2

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!

Panda
  • 6,955
  • 6
  • 40
  • 55
  • How did you rename the App? Could you please explain. – Imran Aug 27 '16 at 15:06
  • 1
    @Imran If u really need to update the Provisioning file, one can just edit the bundle identifier, and it creates a new profile based on that bundle. – Noah G. Mar 10 '17 at 16:24
1

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.

JH95
  • 489
  • 1
  • 7
  • 24