Unusable profiles (no private certificate found)

I swear to God, there is not one single thing in this world that makes me feel dumber and more helpless than dealing with certificates, provisioning profiles and Corona/Solar2D!

Now it´s been a year since the last time and a new mac and the horrors are here again and I wonder why I bother with this crap…

MacOS Big Sur, MacBook Air M1 & Solar 2D 2020.36.28

This time I apparently do not have a private certificate. Is there a way of checking that I´ve done right when creating one?

I agree that certificates and provisioning profiles can be a pain, but I think we can only blame Apple for that. Once the certificates and profiles are set up correctly, I don’t think I have ever had any problems with Solar using them.

So, where do you get this error message? Is it in the simulator when you try to build?

Can you see your certificate in Keychain Access? If not, have you followed the guide in your Apple Developer account to create and install the certificate?

Thanks for the kind reply! Yes, I agree to all your points. It´s an Apple thing and when it´s up and running it works well (until something expires…).

I know very little about the Apple universe and only really use my Mac for building my apps. Probably I´m doing something stupid…

Yes, I have problems when I try to build the app with a “Send to App Store”
Here is a screenshot of my keychain and how Solar2D looks when trying to build:

I don’t see any obvious problem with your certificate. What I would do is start with the provisioning profiles. Go to your Apple Developer Account and check that the provisioning profile looks ok and was created with the correct certificate. If so, download it and install it. If not, just create a new provisioning profile.

You could also try to delete any existing profiles from Xcode manually. This has helped me before when I’ve had similar problems: https://stackoverflow.com/questions/26732251/how-to-remove-provisioning-profiles-from-xcode

If it still doesn’t work, I think it’s easiest to just start from scratch. Generate and install a new certificate and then the same with the provisioning profile. That way you will at least have a better idea where things go wrong if it happens again.

When usually this happens. I just delete them from my machine and redownload them. Make sure they don’t say expired on the apple site.

1 Like

How do you delete a provisioning profile from the machine?

Thanks.

How do I remove “everything” certificate/provisioning profile from the machine so that I can start from scratch?

You shouldn’t need to remove everything. Just the ones that are not working. In the tool right-click and select delete. Download the new one and click on it so it gets installed. The next step is usually to open up xcode and connect the phone so that xcode loads the correct profile on the phone. Then you can close xcode and use it as you were using it before.

I provided a Stackoverflow link in my previous post where you can read how to manually remove all provisioning profiles from Xcode. It’s just a matter of emptying a directory ( ~/Library/MobileDevice/Provisioning Profiles/), and I know that this has helped me several times.

You can download all you provisioning profiles to Xcode again from Xcode -> Preferences -> Accounts -> Download Manual Profiles. Here you can also click “Manage Certificates” to see that your certificate(s) are correctly installed.

To check which profiles are installed on your iPhone:

  1. Connect your iPhone to your Mac
  2. Open Xcode -> Devices & Simulators
  3. Right click your iPhone and Show Provisioning Profiles.
  4. If you don’t see the expected profile there, click the ‘+’ button and add the profile manually. Just download it from your Apple Developer Account first.

I’ve actually tested the above problem.

You need to revoke the certificate and profile from Apple Developer and create a new one.
Existing certificates and profiles do not work on Big Sur OS.

p.s: Open profiles folder command
open ~/Library/MobileDevice/Provisioning\ Profiles

Thank you everybody!

It finally worked when I removed all old certificates and provisioning profiles and then did the whole thing once more. Now all is good for one more year :slight_smile:

1 Like

That’s good to know about Big Sur! I guess I’ll wait some more before updating then… :grin:

Hi @Markus_Ranner & @SUPER_TOKI, thanks for your helpful posts so far. Thanks also @vlads, obviously, for keeping Corona alive.

(apologies for duplication, but I posted this issue on GitHub before finding your forum post:
https://github.com/coronalabs/corona/issues/155#issuecomment-763033732)

Before I follow your advice to re-install certificates, any idea if that will help with the following error?

I can select the correct provisioning profile, but get a build error a few seconds later when trying to ‘send to app store’.

I’m running macOS 11.0.1, Xcode 12.3, Solar 2020.3635, but get the following error when attempting to build for iOS SDK 14.3.

I tried relaxing disc access for Corona Simulator, but no effect, so I’m a bit stumped by this one. I can’t even navigate to the location specified. Any advice gratefully received:

ERROR: Runtime error
/Users/runner/work/corona/corona/platform/resources/iPhonePackageApp.lua:424: unable to generate a unique filename
stack traceback:
[C]: in function ‘tmpname’
/Users/runner/work/corona/corona/platform/resources/iPhonePackageApp.lua:424: in function ‘runScript’
/Users/runner/work/corona/corona/platform/resources/iPhonePackageApp.lua:1215: in function </Users/runner/work/corona/corona/platform/resources/iPhonePackageApp.lua:1135>

Sorry for not replying to you right away. There is actually a problem on this screenshot. You have a certificate, but you don’t have a private key to use it.
If you go to the certificates tab, you’ll see that some certificates have a triangle you can expand near them


You got to select both certificate and key, and export them both as p12.
Key is what makes certificate usable. In fact, you can put certificate public on web if you want for some reason, while key is a highly sensitive information.
You need key to sign.
Provisioning is a sidecart here. Provisioning profile contains specific information about particular application, while certificate - your identity as a developer team.
Actual app signature is generated using the private key on app with provisioning profile in it. To re-iterate. Signing contains 3 main parts:

  1. Private key - randomly generated 2048 bytes only you have
  2. Certificate signed by your private key and Apple’s private key, identifying your team
  3. Provisioning profile generated by apple to identify your app’s capabilities
    All this 3 things required each other, and basically useless w/o each other. Certificate and profile is not sensitive information. Private key is basically your password to submit apps.