ChatGPT解决这个技术问题 Extra ChatGPT

Xcode : failed to get the task for process

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

I have my developers profile selected in the Code Signing for debug. Deleted the Derived Data a few times. Quit a few times Downloaded and tried to re-add my Developers certificates. Reset my computer! And checked updates Tried using black magic! 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.

Check your scheme to make sure you are actually running in debug mode.
I forgot to mention the Scheme > Build Configuration is set to Debug
I'm getting this issue also. In Xcode 4.x no issues. All the settings appear to be the same. Debug symbols should not be stripped in "debug" and scheme runs "debug" for "Run". This is my only code which has this problem. I am using push notifications and shared keychains in this code.
I am going to rebuild the project in xcode5 just sorting repo stuff
Solution #6 is really interesting!! 🤣

h
hasan

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


I suggest than you create a new provisioning profile in dev centre that includes you device. then download it and use it. I am pretty sure it will work.
Build Settings > Provisioning Profile set to 'None' works for debugging to device.
by the way, check that this is done in both the Project and Target build settings (especially Target has the highest priority, so if you like me spend 30 minutes by changing the Project and you didn't realize the Target was different, you will learn this...)
With XCode 6 I had to refresh my provisioning profiles with developer account so that I can see the iOS Team Provisioning profile in Build Settings. To refresh: XCode > Preferences > Accounts > Apple IDs > View Details > Refresh button at the bottom.
Some times this solution does not work if you do not restart xcode. @hasan83 this is still happening
H
Hiren Dhamecha

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.


This is the right answer for most people, I'd guess.
Now it says "My App requires a provisioning profile"
Doesn't work for real devices. Showing error in All Messages: ""AppName" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor." In my case I have the expired apple dev account.
This didn't worked for me. ☹️
A
Alex Christodoulou

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.

If you build + run with a Development Profile + Development Signing Code, everything will be OK 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 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 think for 'AdHoc Distribution profile' you also need to trust the developer team...
I
IMT

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


Yep. That was it. Another 30 minutes wasted thanks to Xcode's downright moronic user interface. Thanks for the save there!
That save me! Thank you so much!
A
Adam

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)


N.B. using v7.3 of Xcode and it still sometimes chooses the wrong provisioning profile when set to 'Automatic' resulting in this error.
w
windfly2006

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

One is that we are debugging an application which is signed with distribution ad-hoc provision profile. 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.

https://i.stack.imgur.com/iJ6ja.png

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'm getting stuck in a loop here -- clicking 'Fix Issue' will take about 15 seconds to talk to the server and then build the app, immediately followed by the exact same prompt to fix the issue.
not sure why it is that way in your case, I just tried the same thing couple days ago, it worked again.
+1 for: Debugging an application which is signed with distribution ad-hoc provision profile. That's what my issue was.
K
Kodejack

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

F
Frank Yin

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)


s
superarts.org

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).


S
Steven Li

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


z
zeeawan

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.


o
onmyway133

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


What a terribly non-descriptive error message for a simple issue. Saved me a bunch of time, thank you.
J
Jackson Smith

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 😎

https://i.stack.imgur.com/6yVvG.png


O
OM7

This link works for me

Choose the problematic scheme Edit Scheme Choose Run Uncheck “Debug executable” Clean Derived Data: ⌘ Cmd + ↑ Shift + K Run the app again: ⌘ Cmd + R


This one works for me. Unchecking the "Debug executable" is the only thing I do in this solution, and it works wonderful.
e
elliotrock

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

Third party SDK not set as a distribution. Third party SDK not set to arm64, which I think I caused as I in vain to fix the issue compiled to arm64. Needed to complete clear out any old certificates and add new ones from Apple. Good thing to do. Xcode 5 hides the certs and profiles in preferences now I think, which added frustrations. 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.


s
samiq

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.


n
n13

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.


S
Sea Coast of Tibet

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.


t
thijsonline

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).


P
Pavel Alexeev

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.


C
Chen Li Yong

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.


k
kumaraprasad7

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.


c
crifan

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


J
Jayprakash Dubey

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

https://i.stack.imgur.com/YVGry.png


A
A_Mo

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

select your schema and press Edit schema On Run tab make sure to set Build Configuration to Debug


S
Stone Monk

Change the adhoc provsioning profile to dev