Monday, January 2, 2012

Arggh! Code sign error - provisioning profile.

Ok, so, today I have to tackle something that cropped up today - a code sign error. I *hate* those. It just is something that is non-intuitive and un-fun.

But, to go along with the new year, I'm adopting a new approach. Slice it up into the tiniest slice of a task possible that will get me toward the solution.

Task one: gather the facts.

What is the problem?

When I try to build my project for archive, I get this unkind error message:

[BEROR]Code Sign error: Provisioning profile '62740BD4-6754-4480-B983-0B85A8FC2D85' can't be found

What led to this?

Well....I was getting an "expiring profile" warning on my project. There are two places in organizer where the profiles are listed. One is in a section called "provisioning profiles".

The other is under "devices".

The difference between them is that if you click on the one above, it will take you to the profiles actual location. The one below, which is apparently connected to the device, won't. It's just a label.

The ones above are the following:

App1 Application Distribution Profile
App2 Development Profile
App2x
TeamProvisioningProfile

The ones connected to my iPond (the provisioning profiles listed for the device) are:

JLPT Vocabulary Quiz Development Profile
JlptVocabQuiz
TeamProvisioningProfile

All of them have expiration dates will in the future.

Now, the *original* problem was that I was getting a warning about an expiring profile. So, I deleted all the profiles which were already expired, or which had nothing to do with this project (I thought), and now I have this error message.

So, my question at this point is - what happened to my friendly distribution profile? I'm not very good about keeping track of where to put these things, all these generated profiles. So, maybe I should just generate another one and reattach it. But how to do that?

So, the question I'm dealing with now is - what's causing this error? It's looking for the provisioning profile, and not finding it, for some reason. I guess I must have deleted it?

These profiles have names. But I'd like to figure out what these names are. I'd especially like to know the one I created. I think it's up on my developer account. Because there is this whole process to generate a certificate request - wait - that's a different thing.

What is the definition of a provisioning profile?

I think we want to get this:

iOS Provisioning Portal

Provision & test your apps on your iPhone, iPad & iPod touch.


Yup, it's the provisioning portal I'm after.

There's a section in there called "provisioning". Inside that, there are lists of development and distribution profiles. Since the problem is happening when I build for archive, my suspicion is that it's the distribution profile.

So, here's what I have for distribution profiles:

JLPT Vocabulary Quiz App Profile id string.com.blah.blah
app id: JLPT Vocabulary Quiz App

1 certificate
1 device



So, very clearly the first one is the distribution profile I use when I distribute the app - although I should have named it something with "distribution" in it.

Now, actually, something to keep in mind is, is the error referring to this provisioning profile? Or is it referring to whatever certificate is being used to sign it? Could this be a certificate issue?

No - the problem is it can't find the provisioning profile.

So, what is the solution? How do it give the provisioning profile? Or do I get rid of the reference in the project to the missing profile?

There's actually a pretty good string of possible solutions here:

http://stackoverflow.com/questions/1760518/codesign-error-provisioning-profile-cannot-be-found-after-deleting-expired-prof


The main one seems to be to edit the project file and get rid of any references to any profiles. But my question is, how to attach the new file?

Ok, when I get into Xcode4, and go into build settings, I can see (under "Target", "Code Signing") under "release", with the confusing "Don't Code Sign" heading, it's listing "iPhone Distribution" which might be one of the ones I deleted, I dunno.

Anyway, I need to figure how to connect my distribution certificate here. First, maybe I'll download it to make sure I'm working with the right one. Then, I will need to figure out how to link it with the app.

Ok, I'm going to download it. The name is JLPT_Vocabulary_Quiz_App_Profile.mobileprovision.

Ok, it just went to downloads. When I double-clicked it, it actually went straight into organizer, the available profiles. Now, let's see if I can specify it in the code signing section.

Sweet! it worked. Nice, I expected to spend 5 or 6 hours on this, it's it's done in 2.5. We like.

No comments:

Post a Comment