[xcode] Failed to create provisioning profile

I'm trying to create a project in Xcode, Version 8.0 beta 6 (8S201h) and I'm getting this error.

enter image description here

The apple account is a free one because I'm just playing around with Xcode but it is forcing me to set it as a Team. Any help?

This question is related to xcode

The answer is


The issue behind this error is Unavailability of App ID with given Bundle Identifier

Solution: Change Bundle Identifier simple :)


Check these things.

1.A device is connected to your system or not.

2.Deployment target in xcode. (General->Deployment info->Deployment target) It should match with the ios version of your device.

3.Change your bundle identifier. Follow general rules of setting a unique bundle identifier for yourproject while running in device. See this what is correct format of bundle identifier in iOS?

Also be careful with the number of bundle identifiers you set in the project. Please remember all bundle identifiers or note it down somewhere. Since you are using a free account you have limited access to the number of bundle id's.

You should also disable push notifications in the "Capabilities" section of the project. Try changing "App groups" as well in the format of group.com.someString.

These things helped me run my app in real device without any errors.


Change the bundle identifier to something more unique.

If you are following a tutorial and just put a generic identifier then adding a few numbers to the end will likely solve your issues.

i.e. if you had HelloWorld change it to HelloWorld12345


After some time with the same disturbing error and after I write a unique Bundle Identifier and it didn't help, I searched the web and found here that my error was that I selected a virtual device and not an real device. The solution was:

1.I plugged my iPhone

2.I clicked on the button - set the active scheme. and there it was on the top - device iPhone. the error has gone.

enter image description here


I had same problem with provisioning profile. If you have any kind of iPhone, you can connect to your Mac with cable and provisioning profile is automatically defined. enter image description here


Manual:

  • Go to your apple developer account and hit certificates
  • Select devices from the left side
  • Add the device name and its UDID. Close Xcode and hit automatic signing

Automatic:

  • Attach your iPhone to Xcode. and run the app on that. Xcode will automatically create a profile.

Change bundle identifier, Straight solution


I have had this error multiple times and what solves it for me is the following:

  1. In the list with the view of all certificates, right click on each row and move each certificate to trash (go to Xcode > Preferences > Choose account > Click View Details)
  2. Go to member center download the right certificates again and click on them so
  3. Restart Xcode
  4. Go to build settings and set the right Code signing for debug/release - you should be able to see an option on the row that says "Identities from profile..."

If this doesn't work then you should consider revoking your certificate and then create a new one and the do the steps above again.


Adding this because it took me 4 hours to figure out..

Xcode will fail to create the provisioning profile for a device with no name, i.e. "" or " ". When I changed my device name to something else, the steps above worked.


Both of these errors arise as a result of a provisioning profile not existing. To create one, simply do the following as suggested in the error message:

  1. Plug in your Apple device
  2. Choose the device from the schemes/simulator menu
  3. Thereafter, provisioning profile will automatically be created

enter image description here


For me this happened when I tried to run on a device with a newer version of iOS than supported by the version of Xcode I was running.


What saved me from this error was when I changed my Bundle Identifier.

Try and do that


In my case this error disappeared when I changed the "Bundle Identifier" to something less generic (e.g. adding some random numbers at the end)


This error is because you selected a target rather than a project name, so please, at the left side of general in Xcode you will find your project name. Click on it and change it from target to project section.


Change Deployment Target to newer version and then solved


For me this happened when I was making a tvOS app and didn't have a appleTV registered.

In general, you need to plug in the device or have logged into it (connected to it)..then it shows up here: https://developer.apple.com/account/resources/devices/list

You can also add devices there..you need to click reset to be able to add a new device. the reset button should be labeled modify because it doesn't reset anything.

for example, if you need to make a tvOS app then you need to have an apple TV in the device list. Once you add that then you're good to go. kisses.


preparing debugger support

Profiling your Phone takes a few minutes. . . watch the status bar on the top to be sure that your phone is being profiled on the top.

Next, be sure you choose YOUR PHONE as the target, not iPhone 7 or iPhone 8... your exact phone. This is done by choosing: Product > Destination > (pick your phone)

Your phone will only show up after it's been plugged in, turned on, and left running for a few minutes while Xcode creates a profile. destination


After struggling for an hour, I just unchecked the "Automatically manage signing" and went back to the old school way of specifying my profiles. Probably not the best thing to do but works.