1

My Xcode suddenly got a weird issue that there's some provisioning profiles I couldn't download or even import them manually. Got an error message all the time. enter image description here

I tried to uninstall and reinstall Xcode again, and still got the problem. Also, I manually copied the profile into ~Library/Mobile Device/Provisioning Profiles folder, and my Xcode wouldn't recognize it. Have anyone seen the issue before? Please don't ask me to delete and re-create the profile as it's a company provisioning profile, and it worked on my colleagues' computer.

Just recognize I was able to load or install all distribution profiles, all development profiles got the issue.

Cœur
  • 37,241
  • 25
  • 195
  • 267
LongNV
  • 892
  • 9
  • 21
  • Does it appear after deleting the derivedData and after project cleaning? – George Oct 04 '18 at 17:54
  • @George_E_2 it stills happen. – LongNV Oct 04 '18 at 18:04
  • I'm not sure then, sorry :p – George Oct 04 '18 at 18:05
  • The error says it's missing the UUID property...first thing I would do if open the profile profile in a text editor and check to see if a UUID is there. – Jake Oct 04 '18 at 18:23
  • @Jake: Does it mean device's UUID? Pretty sure it was there, but I don't know why missing device's UUID doesn't allow me to install that profile. – LongNV Oct 04 '18 at 18:47
  • @LongNV - Provisioning profiles also have a uuid. This uuid is in the file and it is what Xcode uses to identify the profile. This has nothing to do with the devices’ uuids. – Jake Oct 04 '18 at 18:50
  • Try installing this on your Mac and see what the profile shows you just to check on the UUID: https://github.com/ealeksandrov/ProvisionQL – Jacob M. Barnard Oct 04 '18 at 19:17
  • If it is a developer profile (and not a distribution profile), you should see the UDIDs of the devices provisioned when you use the Quick Look on the provisioning profile with ProvisionQL installed. BTW: UUID is for profiles, UDID is for devices. – Jacob M. Barnard Oct 04 '18 at 19:19
  • @JacobBarnard: I saw both of them there. – LongNV Oct 04 '18 at 20:46
  • By the way, I have to delete all provisioning profiles on my computer. Delete and reinstall a new Xcode then the problem goes away. – LongNV Oct 04 '19 at 17:55

3 Answers3

0

Here are a few checks I go through when I get anomalous behavior from Xcode with respect to development provisioning profiles.

  1. Check to ensure that you have selected the correct Apple ID and correct Team by clicking Xcode > Preferences > Accounts > select the correct Apple ID on the left-hand side of the panel, and select the correct Team at the lower-right hand side of the panel
  2. Check to ensure that you have installed the necessary components for Xcode by clicking Xcode > Preferences > Components > ensure the correct Toolchain is selected, then > Check and Install Now
  3. Download the provisioning profile manually from the Apple Developer Portal, then drag-and-drop it onto your Xcode dock icon.
  4. Open your project in Xcode and click on the project icon in Project navigator > Build Settings > scroll down to Code Signing Identity > ensure is set to iOS Developer
  5. While still in Build Settings, scroll down to Provisioning Profile > ensure the name of the profile you expect is selected or that it is set to Automatic
  6. Try to build.

If that doesn't work, you can try altering step 4. by doing the following instead:

  • Make sure to not select "Automatic" for the "Provisioning Profile" field(s) in Xcode > Build Settings
  • Instead, set all "Provisioning Profile" fields specifically to the profile with which you are trying to build
  • open the Terminal app
  • cd to the directory of your Xcode project
  • cd into your Xcode project, like so: cd MyProject.xcodeproj/
  • cd xcuserdata
  • open project.pbxproj -a TextEdit
  • hold the "command" key and tap "F" on your keyboard
  • enter 'PROVISIONING_PROFILE' and press 'return'
  • if 1 or more results are found, ensure the value to the right of the PROVISIONING_PROFILE variable is set to the UUID of the profile you want (i.e. compare to what you see in Quick Look to ensure a match)... if 0 options are found, something else may be wrong with your xcodeproj file
  • the UUID should be a string (surrounded by double-quotes), e.g. PROVISIONING_PROFILE = "abcdef01-2345-6789-abcd-ef0123456789";
  • save the file with TextEdit and then close TextEdit
  • try to build again
Jacob M. Barnard
  • 1,347
  • 1
  • 10
  • 24
  • Thanks for your answer. I got the error step 2, when drag profile on XCode to install, it threw above error message. – LongNV Oct 05 '18 at 18:40
  • Try steps 3 through 5 anyway. Use the alternate bullet points for step 4. What do you get? – Jacob M. Barnard Oct 08 '18 at 12:24
  • I saw no provisioning profile available to build, then XCode asked I need to import or download it. In case I imported that profile or download it, it would show that error message. – LongNV Oct 08 '18 at 21:24
  • Don't try to enter the provisioning profile using Xcode GUI. Specify it directly using TextEdit and enter the UUID directly into the `.pbxproj` file. See the unnumbered bullets in my answer. (Use source control to revert if you accidentally corrupt the `pbxproj` such that Xcode won't open the project). – Jacob M. Barnard Oct 09 '18 at 13:15
  • I also added a new "step 1" - see if that helps. – Jacob M. Barnard Oct 09 '18 at 13:18
0

For those who also got this issue, I was able to resolve this bug by deleting complete my XCode 9.4.1 and all local provisioning profiles, and update to latest XCode 10.0. After that, I can install and load all profiles as usual.

LongNV
  • 892
  • 9
  • 21
0

Kindly make sure installed mobileprovision file is valid, otherwise kindly regenerate the mobileprovision from developer.apple.com site and import it manually in xcodeproject IDE.

arunkumar A
  • 53
  • 1
  • 7