2.25.2011

Adventures in iOs Provisioning Land

Wow. I just spent the better part of a day chasing down the strangest issue so I figured I'd post what happened and how I fixed it. Hopefully, if you're reading this, it helps you in your plight.

I recently got a new Macbook Pro and have been in the process of getting all the stuff I actually need off of my previous laptop. I had been developing on iOS from this old laptop without issue. I went to build a project last night on my new laptop and was, mysteriously, unable to build. Instead I received the following error in the build results: Command /usr/bin/codesign failed with exit code 1.

After the requisite Google search on this error I had some links to a few possible causes of the issue. Most of them had to do with duplicate or incorrect certificate and provisioning profiles. I removed them all, started from scratch, followed Apple's provisioning instructions to the letter, and still was unable to build my app. I repeated this nonsense a few times and dug deeper.

IThe idea to check the raw build logs occurred to me and I found this odd string tacked onto an error: "CSSMERR_TP_NOT_TRUSTED". Again, I dumped it into Google and started reading. Again, I was pointed in the direction of certificate issues. None of the solutions I found solved my issue though. Now it was time for good ol' experimentation.

Two things led to my eventual release from provisioning purgatory. Firstly, I did not have the "Apple Worldwide Developer Relations Certification Authority" certificate installed in my keychain. This can be downloaded from the provisioning portal after logging into the developer center and installed by double clicking the downloaded file. Just make sure you're using Safari because, for some reason, the certificates cannot be downloaded properly in other browsers. Secondly, I went into Keychain Access and started mucking about. For each certificate you have that has anything to do with iPhone development, get info on the certificate and expand the "Trusted" section. Set the first drop down menu to "Always Allow". Close this window, put in your admin password and continue to the next certificate. Now, go back through each certificate, change the trust back to "Use System Defaults", close and save. At this point, go back into XCode and attempt to build your project again.

The jury is still out on why this worked for me. Other people fixed this problem with different solutions but, if you end up at wit's end like I did, try this and let me know if it works. Anyone else ever have this issue? Anyone else fix it?

No comments:

Post a Comment

share

Bookmark and Share