Question

This is for an existing app that compiled and distributed multiple times. Since updating to Xcode 5 I have this error popping.

  1. I have my developers profile selected in the Code Signing for debug.
  2. Deleted the Derived Data a few times.
  3. Quit a few times
  4. Downloaded and tried to re-add my Developers certificates.
  5. Reset my computer! And checked updates
  6. Tried using black magic!
  7. The Scheme > Build Configuration is set to Debug

The odd circumstances I am compiling to compile to iOS 6.1 so I can run on my iPhone 3GS - the base is SDK iOS 7? Could this be an issue? I just need to test it before finding a newer phone to before change it to iOS 7.

Was it helpful?

Solution 14

I have not accepted the answers above as there was a chain of issues that I needed to resolve:

  1. Third party SDK not set as a distribution.
  2. Third party SDK not set to arm64, which I think I caused as I in vain to fix the issue compiled to arm64.
  3. Needed to complete clear out any old certificates and add new ones from Apple. Good thing to do.
  4. Xcode 5 hides the certs and profiles in preferences now I think, which added frustrations.
  5. Then making sure the correct provision profiles are selected across the debug and release settings in your Build settings.

As always thanks for peoples help.

OTHER TIPS

This error tends to appear when you pick an ad-hoc provisioning profile. Make sure that your code signing is for development.

This error happens if you have used a Distribution Provisioning Profile for debugging to device.

Go to

Build Settings > Provisioning Profile and set to 'None' for Debugging.

When your device is connected to your computer with a cable and you Build + Run your app, your device will try to debug. Debugging is only permitted for Development profiles.

  1. If you build + run with a Development Profile + Development Signing Code, everything will be OK

  2. If you build + run with an AppStore Distribution profile + Distribution Signing Code, the app will not even reach your device. This build is only for uploading to AppStore

  3. If you build + run with an AdHoc Distribution profile + Distribution Signing Code, you'll get the "failed to get the task for process..." error, but the app will get installed in your device. Unplug the device and run the app from your device. It's running in distribution environment. Enjoy :)

I finally solved this by remembering to set code signing and provisioning parameters in BOTH project and target tabs...

UPDATE:

Xcode 5.1 appears to fix the dropdown so that it now shows a "(blah blah)" whenever two profiles have the same name. This lets you pick the correct one. Which is much better :)


Bitten by this a few times. Xcode5 shows "Provisioning Profile" as a single field, WHICH IS ALWAYS INCORRECT and Apple SHOULD NOT have coded their GUI like this (beginner mistake there from Apple).

In Xcode5 (no previous version), you have two values of "Provisioning Profile". This MUST BE set BEFORE you set your "Code Signing Identity". Obviously, since it has to be set FIRST ... Apple placed it SECOND on the list, 3 items BELOW the thing it has to be set "before".

(bonus points for terrible GUI design there...)

It's also broken: if you have two Provisioning Profiles for the same name, Xcode5 will only allow you to select one of them. To work around this, you have to use iPhone Configuration Utility to find the Profile you want, find the 30-digit "Profile Identifier" and copy/paste it into the "Other" value of the Provisioning Profile dropdown.

Your Provisioning Profile MUST have a value for "Debug" and a different value for "Release" (unless you build a custom mega-profile by hand, Apple keeps the two separate).

The Debug profile will often have the same-name bug described above - most people will be using Apple's auto-generated Team Provisioning Profile, which Apple incorrectly always names the same, for all Targets, in all Projects. (another bug in Xcode5).

Once you've set both values, your "Code Signing Identity" field will finally start working correctly. In fact, it works nicely: in most previous versions of Xcode, this field was broken, and the "automatic" selection rarely worked. In Xcode5, it can ONLY use code-signing values found inside the Provisioning Profile you've pre-selected - and so it seems to get it correct 100% of hte time.

(i.e. you can safely set it to "Automatic". In previous versions of Xcode, Xcode would often "Automatically" use a Distribution profile for a Developer build, and vice-versa, causing lots of problems)

Based on my current search, the error "Failed to get the task for process" at xcode 5 could happen for multiple reasons:

  1. One is that we are debugging an application which is signed with distribution ad-hoc provision profile.
  2. Another reason is that somehow xcode5 could not find the correct development provision profile although the coding signing identity has the developer signing identity there.

For me, it is the second case which seems the case as well for this question.

I am able to fix this by changing debug provision profile dropdown to the correct development provision profile and then trying to load the app to real device. Xcode would give this below error: enter image description here

click "Fix issue" to continue, xcode 5 would fix the issue. After the issue is fixed, the provision profile for debug is reset to "None" again, not sure why xcode would do that though.

I had this issues and as once I had set both the CODE_SIGN_IDENTITY and the PROVISIONING_PROFILE it all work fine,

Please note this has change in Xcode 5, previous version had no entry for PROVISIONING_PROFILE in build settings

//:configuration = Adhoc
CODE_SIGN_IDENTITY = iPhone Distribution: orgname
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution: orgname

Note that here I had to manually write the iphone developer into the second entry as automatic selection didn't seem to work

//:configuration = Debug
CODE_SIGN_IDENTITY = iPhone Developer: Joe Bloggs (0A0AA00A00)
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer: Joe Bloggs (0A0AA00A00)

//:configuration = Release
CODE_SIGN_IDENTITY = iPhone Distribution: orgname
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution: orgname

Then update and the provisioning profile settings

add you profile ids 0000 are just for privacy

//:configuration = Adhoc 
PROVISIONING_PROFILE = 11111111-1111-1111-1111-111111111111
PROVISIONING_PROFILE[sdk=iphoneos*] = 11111111-1111-1111-1111-111111111111

//:configuration = Debug
PROVISIONING_PROFILE = 00000000-0000-0000-0000-000000000000
PROVISIONING_PROFILE[sdk=iphoneos*] = 00000000-0000-0000-0000-000000000000

//:configuration = Release
PROVISIONING_PROFILE = 22222222-2222-2222-2222-222222222222
PROVISIONING_PROFILE[sdk=iphoneos*] = 22222222-2222-2222-2222-222222222222

Try restarting XCode

After setting Provisioning and Code Signing settings from all these suggestions, a restart was what finally allowed it to run with Provisioning set to none and Code Signing set to iOS Developer (Automatic)

It may cased by provisioning profiles. For my case, I tried to run the app on my phone and the provisioning profile was set to adhoc profile (XC Ad Hoc), hence the error. I need to change it to iOS Team profile that's managed by xcode (to avoid manual work on dev center).

actually,It's your Provisioning Profile --Debug is incorrect。

hasan83's answer worked for me. Adhoc provisioning was giving this error and my device was also not included in that provisioning file. I set automatic for provisioning and built. Xcode prompted to fix the issue and thus fixed the issue by downloading and setting the developer provisioning file.

In my case, it is because the selected scheme Run action points to another Target, whose Code Signing Identity is set to iPhone Ditributor

I Tried everything but this not works for me on Xcode 13.

But a lot of people is right, the big change maybe was Xcode UI.

As they sad the problem reason is, AdHoc is not debuggable...

So i had to turn of Debug executable mode in my target as i show on image bellow.

And Works 😎

enter image description here

So after testing all this options the way I think is correctly is that now you have to create a provisioning profile for development, not only distribution. go to the preferences pane and under the provisioning profiles click on create new, select development and then go to build settings and set the signing to automatic ( this will select the correct provisioning) this made it for me.

I'd have expected Apple to be more informative when they do changes like this default

cheers,

G.

Thanks to all the help in the other answers, I solved it like this:

  • Created new, empty project
  • Ran it on the device - it worked fine
  • In the old project, open the "Project, Targets" tab.
  • In Project, set All code signing properties to the same as the new empty project (all off in my case)
  • In Target, do the same for your target.

At this point, it's hard to tell which setting is for which mode of operation so I just started from a project where everything works.

Just had the same problem - app was being installed OK, but won't run from Xcode with the "process launch failed: failed to get the task for process".

Turns out my development certificate expired during the night. Regenerating the certificate and the provisioning profiles solved the problem.

This problem happend to me because I removed a 'Configuration' under Project => Info.

To resolve this, go to 'Product' => 'Scheme' => 'Manage Schemes'. Edit the active scheme and check if the 'Build Configuration' is not specifying any deleted configurations for each process (Run, Test, etc).

In my case Xcode could not automatically set the right iOS Developer Profile for Debug build configuration. I was to set it manually to iPhone Developer: My Name (XXXXXX):

Target Build Settings → Code Signing → Code Signing Identity → Debug.

In my case, I can't set the provisioning profile to 'none' because I need a provisioning profile for push notification. So what I did is I just create another provisioning profile on Apple developer, a provisioning profile for iOS developer (not iOS distribution), tied to the same app ID. Then use that provisioning profile for your app in Build Settings tab.

In my case, the development team(Xcode 12.2) in the Build settings for Target and Project are different. It worked after using the same team.

This link works for me

  1. Choose the problematic scheme
  2. Edit Scheme
  3. Choose Run
  4. Uncheck “Debug executable”
  5. Clean Derived Data: ⌘ Cmd + ↑ Shift + K
  6. Run the app again: ⌘ Cmd + R

My case:

Final solution:

  • upgrade from XCode 13.0 to XCode 13.1

Root cause

XCode's bug, not generated proper Provisioning Profile for iOS app/project

which cause: can not debug app failed to get the task for process

and its internal specific error reason is:

A valid provisioning profile for this executable was not found

after upgrade XCode, bug fixed, issue solved

I simply enabled Automatically manage signing option from Signing & Capabilites of project settings.

Screenshot There after I changed build identifier by adding some random number at the end and it worked for me.

I had the same issue and solved it , basically to understand what happened see this answer here, and adding to it you can :

  1. select your schema and press Edit schema

  2. On Run tab make sure to set Build Configuration to Debug

Change the adhoc provsioning profile to dev

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top