quux
quux

Reputation: 487

Code sign error with Xcode 3.2

I had a fully working build environment before upgrading to iPhone OS 3.1 and Xcode 3.2. Now when I try to do a build, I get the following:

Code Sign error: Provisioning profile 'FooApp test' specifies the Application Identifier 'no.fooapp.iphoneapp' which doesn't match the current setting 'TGECMYZ3VK.no.fooapp.iphoneapp'

The problem is that Xcode somehow manages to think that the "FooApp Test" provisioning profile specifies the Application Identifier "no.fooapp.iphoneapp", but this is not the case.

In the Organizer (and in the iPhone developer portal website) the app identifier is correctly seen as 'TGECMYZ3VK.no.fooapp.iphoneapp'.

Also, when setting the provisioning profile in the build options at the project level, Xcode correctly identifies the app identifier, but when I go to the target, I'm unable to select any valid provisioning profile.

What could be causing this problem?

Update: I've tried to create a new provisioning profile, but still no luck. I also tried simply changing the app identified in Info.plist to just "no.fooapp.iphoneapp". The build succeeds, but now I get an error from the Organizer:

The executable was signed with invalid entitlements. The entitlements specified in your application's Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016).

This seems reasonable, as the provisioning profile still has the "TGECMYZ3VK.no.fooapp.iphoneapp" application identifier.

I also double checked that all certiicates are valid in the Keychain.

So my question is how I can get Xcode to see the correct application identifier?

UPDATE: As noted below, what seems to fix the problem is deleting all provisioning profiles, certificates, etc., making new certificates / profiles and installing them again. If anyone has any other solutions, they would be welcome. :)

Upvotes: 31

Views: 58209

Answers (16)

neoneye
neoneye

Reputation: 52231

Quick Hack if you are on Xcode 4.3.

In Xcode under Project Settings > MyTarget > Summary tab all the way in the bottom there is a checkbox that says "Enable entitlements". When I unchecked it, it made the error go away.

Upvotes: 2

superarts.org
superarts.org

Reputation: 7238

The device may not be in the list. Try modify your provisioning profile.

Upvotes: 1

PowerAktar
PowerAktar

Reputation: 2428

Sometimes Xcode does not automatically copy your provisioning profile to the right location. In my case, that was true.

Check that your provisioning profile is in ~/Library/MobileDevice/Provisioning Profiles directory and if not just drag and drop, clean and build

Upvotes: 0

George Lambert
George Lambert

Reputation: 626

Another cause is if the device you want to install onto is not an approved device in the Distribution Certificate.

Upvotes: 0

Damien Laughton
Damien Laughton

Reputation: 11

After being stumped by this for quite a while I revisited the settings and discovered that I had reversed the 'Code Signing Identity' and the 'Any iPhone OS Device' entries. - The clue I had as to this happening was shown by.

  1. Deleting every profile off the phone
  2. Build and Go

At this point xcode attempts to provision the phone (device)

  1. Examine the phone to see which provisioning profile has been added.

As I prefix all my profiles 'AdHoc' or 'Development' or 'AppStore' I saw immediately that the install process was putting a development profile on the device and not an AdHoc profile.

Upvotes: 1

quux
quux

Reputation: 487

Well, as seems to be the case with a lot of these code signing issues, deleting all provisioning profiles, certificates, etc. and revoking and generating everything all over again turned out to do the trick. I even created a new bundle identifier, app identifier, etc., and now AdHoc distribution is working again.

Upvotes: 16

maz
maz

Reputation: 8336

Inside Resources/Entitlements.plist there is a Boolean "get-task-allow" if that is not checked, check it ON. This fixed the issue for me.

Upvotes: 1

Matt N.
Matt N.

Reputation: 1239

Double click the target then select the "Properties" tab. There change the com.yourcompany.${...}.

Upvotes: 0

dijipiji
dijipiji

Reputation: 3099

Check both Code Signing Entitlements in info for both the Build Target and the Main Application - if Code Signing Entitlements says on either then remove it

Upvotes: 5

Jamey McElveen
Jamey McElveen

Reputation: 18325

The problem is in the "project.pbxproj" file located inside the [your project].xcodeproject file. If you feel brave right click on the .xcodeproject and view contents then open "project.pbxproj" with a plan text editor. Inside search for the offensive path and correct it. In my case I just removed the entire path and just left "Entitlements.plist" and it cleard my issues up. I STRONGLY reccomend backing up your .xcodeproject before attempting this.

Upvotes: 0

Topher Fangio
Topher Fangio

Reputation: 20687

For reference, I ran into the same issue and deleting all of my profiles, existing certs and everything from my local drive and from the developer portal, and deleting my existing devices and re-adding them (developer portal) seemed to do the trick.

Upvotes: 0

Henry Cooke
Henry Cooke

Reputation: 2572

Just to add a note here: I encountered the same error (0xE8008016) after replacing my Macbook's logic board (although I imagine you'd have the same problem on a completely new mac), and after hours of going around in circles I realised that the iPhone Developer Program Portal had separate certificates for Development and Distribution.

A change in hardware means you need to reissue both certificates - I'd reissued Developer but not Distribution. Because my name hadn't changed when my hardware did (and certificates are identified by the owner's name), this made it a tricky problem to spot ;) Hope this saves someone else my frustration.

Upvotes: 0

user194584
user194584

Reputation:

Also, make sure that you added a reference to the Entitlement filename "dist.plist" in your project configuration CODE_SIGN_ENTITLEMENTS.

Upvotes: 5

Simon Woodside
Simon Woodside

Reputation: 7314

I had this same error yesterday. I tried all of the various resetting procedures in the other answers with no luck. Eventually I also

  • rebooted my mac
  • rebooted my iPhone
  • deleted all of my iphone provisioning profiles from the phone using XCode
  • deleted all profiles from my mac (~/Library/MobileDevice/Provisioning Profiles for me)
  • what else? deleted build folder, restarted XCode, installed update to 3.1.2 sdk, sacrificed a chicken.

Lo and behold, it now works, the error is gone. This is serious voodoo territory.

Upvotes: 5

Daddy
Daddy

Reputation: 9035

I had to manually remove the provisioning profiles from my phone, then rebuild the apps after doing a "clean all targets" from the build menu.

That's under Settings -> General -> Profiles

This happened to me when I got a new Mac. You'll fix it, don't worry

Upvotes: 21

ennuikiller
ennuikiller

Reputation: 46985

In XCode, in the "Groups & Files" pane, expand "Targets" and double-click on your app's target.

This will bring up the Info pane for your target. In the "Build" section, check the "code signing" section for any old profiles. This has happened to me many times particularly after an upgrade to a new version of the sdk and iphone os

Upvotes: 4

Related Questions