35

I am new to mac and i am getting this error as below image

What should i do i have bought the developer licence and i created the provisioning certificate but still i am facing this issue. i am not sure why i am getting this error any help.

i have followed this youtube link inorder to create a provisioning profile and distrubution profile https://www.youtube.com/watch?v=Xh2nnjttOwo&t=367s

UPDATE

after updateing my buildsettings like this below img

and i am getting new error like this img

Mohan Gopi
  • 7,606
  • 17
  • 66
  • 117

13 Answers13

52

I had the same problem in a project that i used push notifications what i did to fix it is : Target-> Capabillities and turned on push notifications .fix

Note: the answer from @codebrew explains this clever fix further.

Fattie
  • 27,874
  • 70
  • 431
  • 719
Alexis_Ni
  • 907
  • 7
  • 14
46

I was able to resolve this by deleting all my provisional files on my computer (~/Library/MobileDevice/Provisioning Profiles) and restarting Xcode.

Paul Cantrell
  • 9,175
  • 2
  • 40
  • 48
Jim Bak
  • 638
  • 1
  • 8
  • 17
  • Ran into this on iTunes Connect. Deleted all my PP, restart Xcode, resolved. Oh and I believe this occurred because I added a new device in between Archive builds and then got this issue. Weird. – MichaelG Oct 20 '17 at 03:25
  • Thanks for sharing it – mastro35 Jan 25 '18 at 11:36
28

I was able to fix this same issue by turning on push notifications and then turning them back off.

Not sure why this works, but in Xcode 9.4.1, and Xcode 10 Beta this fix still works.

Update: This works in Xcode 10.1 & 10.2

Luke Davis
  • 315
  • 3
  • 9
16

Xcode 9 and 10 may pop up this error because it's looking for a entitlements file for the target. You can turn on Push Notification in the target's Capabilities tab then turn it off to create an empty entitlements file for the build, then this error goes away.

CodeBrew
  • 6,457
  • 2
  • 43
  • 48
7

Under Code Signing Identity, change iPhone Distribution to iPhone Developer for Debug section.

xiangxin
  • 409
  • 6
  • 18
2

I had this issue becaue XCode wasn't generating the entitlements file for Objective-C projects, no matter what I did. I solved it by doing the following:

  1. Create an empty file at the root of your project(at $SRC_ROOT).
  2. Paste the empty entitlements file template
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>
  1. Save it as YourAppName.entitlements
  2. Go to Build Settings -> Signing -> Code Signing Entitlements and enter the path to your entitlements file - in my case $(SRCROOT)/YourAppName.entitlements

You might need to regenerate the Provisioning profiles after this (see @Jim Bak's answer above).

Mercurial
  • 2,095
  • 4
  • 19
  • 33
2

For 2020 ..

Incredibly, Apple still have not fixed this in Xcode 11 onwards ...

The usual fix is the @CodeBrew solution above:

"turn on Push Notification in the target's Capabilities tab then turn it off ... this error goes away.

It's that easy (usually).

Community
  • 1
  • 1
Fattie
  • 27,874
  • 70
  • 431
  • 719
1

I'm very new to iPhone development too and had an identical issue with an ionic project. I executed ionic cordova platform add ios, navigated XCode to the ionic generated platforms/ios/, checked the bundle id, associated my Apple developer Id with this App, let XCode manage my signing certs and provisioning profiles and hit the problem immediately.

So I made an XCode generated project with the same Bundle identifier and Apple developer team values and that was all cool. Which proved my Apple Id and certs were fine.

I compared the Code Signing values under XCode Building Settings (All) and in my case the issue was around the contents of the debug version Code Signing Entitlements file, which revealed I hadn't set up the aps-environment stuff properly.

AlgebraWinter
  • 321
  • 2
  • 3
1

For me unchecking and re-checking "Automatically manage signing" (on "General" tab) solved this.

Chuck Boris
  • 1,275
  • 1
  • 11
  • 9
0

I had the same issue on a multiplatform project (iOS / macOS). In my case the problem was caused because the Code Signing Entitlements build settings of both the iOS and macOS app referred to the same Entitlements.plist file that was part of the macOS app. So to fix this I created an empty Entitlements.plist for iOS and made the iOS build setting refer to this file.

Wolfgang Schreurs
  • 11,779
  • 7
  • 51
  • 92
0

For me the answer was turning on and then off at least one thing in the Capabilities page for ALL targets. The app, watch and watch extension. Even though I already had entitlement files that exactly matched what xCode created, something else changed when it regenerated the files.

Allan
  • 11
  • 1
0

I had the same problem with Xcode 10.2. I noticed the errors went away when I switched to the simulator device instead of my test devices. So I copied the source code of the entitlements file in case I needed to recreated it and deleted the contents of it. I ran build with my first test device physically connected. It made me type in my mac password about 40 times while it created the build but then it added the information back to the entitlements file and the errors went away. Turning notifications on and off didn't work and neither did adding capabilities to the developer account in any configuration.

0

On Xcode 11, make sure to remove this line:

<key>BuildSystemType</key>
<string>Latest</string>

Seems like this was only necessary whe there was two distinct build types and now it just breaks the building.

Dielson Sales
  • 1,715
  • 1
  • 20
  • 25