19

I have removed some of the devices from the provisioning profile from apple portal for adhoc distribution and downloaded and installed it in xcode 6. But upon archiving the project it shows the error for missing devices and invalid provisioning profile .enter image description here

I have wasted 3-4 hours regarding this issue but found no luck. Any kind of help would be greatly appreciated.

SandeepAggarwal
  • 1,273
  • 3
  • 14
  • 38
  • 4
    Go in to Xcode > Preferences and select your apple ID, double click the nam in the right hand panel and press the refresh arrow in the bottom left of the new pane. Then go and double check that the provisioning profile you sign with is the updated one you expect. – Gary Riches Feb 18 '15 at 14:25
  • @GaryRiches I tried this previously also and now again but it still not works. – SandeepAggarwal Feb 18 '15 at 14:30
  • Ok, and lastly from me, have you tried pressing "Try Again"? As infuriating as it is, this sometimes works for me. – Gary Riches Feb 18 '15 at 14:30
  • @GaryRiches upon 'Try Again' xcode created a provisioning profile 'XC Ad Hoc', in which all the deleted and undeleted devices are present and now upon pressing the 'export ' button it will create the archive but for all devices which I dont want. – SandeepAggarwal Feb 18 '15 at 14:37

5 Answers5

22

I just had this error as well. I am not sure if all of these steps are required, but the is exactly what I did to fix it, and it worked for me...

  1. On the device, I removed the provisioning profile that was in General -> Profile.
  2. In Xcode, under window tab open up the "Devices" window. (shift+cmd+2)
  3. Choose the device and copy its identifier
  4. Login to developer.apple.com and go to the "Certificates, Identifiers & Profiles" area
  5. If the device in question is not registered, register it in the "Devices" area. (My device was not registered, so I registered it)
  6. In Xcode preferences under Xcode tab, go to the Accounts tab and choose your Apple ID.
  7. Choose the identity from the list and then hit the "View Details..." button.
  8. Under "Signing Identities", only "iOS Development" was listed.
  9. Click the "refresh" button on the lower-left of this details page.
  10. I was informed that I didn't have a distribution certificate and asked if I wanted Xcode to request one for me. I chose Yes (or Request)
  11. 'iOS Distribution" then showed up also, just under the "iOS Development" entry
  12. Hit the "Done" button
  13. Exit from the Xcode preferences
  14. Choose the Target for your project, then choose the "General" tab
  15. Choose the "Team" dropdown and pick your team, even if it is already selected. This causes Xcode to refresh its info about the Team.

At this point, my warning next to "Team" went away. I then tried to run my app on the problem iOS device again and it worked as expected.

I hope that by following these steps, it will at least help you get closer to fixing your problem.

demiculus
  • 1,243
  • 1
  • 12
  • 32
Perlguy
  • 982
  • 10
  • 25
7

I only have this problem when archiving so I do not bother to investigate, unplug the iPhone and archiving works just fine.

Qiulang
  • 10,295
  • 11
  • 80
  • 129
5

In my case I needed to remove the Team ID from the bundle identifier in targets settings > General.

If you have the Team selected below this id will be added automatically.

PiTheNumber
  • 22,828
  • 17
  • 107
  • 180
2

I followed a lot of the instructions out there about resetting profiles and restarting xcode but still had no luck. Eventually I set team to 'none' and reset the build configuration as indicated here:

https://developer.apple.com/library/ios/qa/qa1814/_index.html

Bingo.

This was for a project I hadn't updated in a year or so and I had just updated to xcode 7.3.

Chris Hobbs
  • 495
  • 6
  • 5
2

I had a similar problem where my device was properly registered and had been working for some time before suddenly stopping. All of the provisioning profiles were up to date and I was still able to download other Xcode projects onto my device. My developer account was listed as the Team under Targets -> General -> Team but it still wouldn't work. So I switched Team to None and attempted to build the Project again. It gave me an error for not selecting a valid Team, but then an option popped up to choose one of the ones registered earlier in Accounts. I just clicked on my developer ID and that seemed to fix the problem.

Brian Li
  • 2,260
  • 1
  • 15
  • 18