348

Now I'm trying to Product>Archive my iOS app to submit. However, I am getting following errors:

AppName has conflicting provisioning settings. AppName is automatically signed for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set the code signing identity value to iPhone Developer in the build settings editor, or switch to manual signing in the project editor.`

Code signing is required for product type 'Application' in SDK 'iOS 10.1'`

The situation won't change even those I've retry a whole process to recreate iOS certificates or provisioning profile.

I was setting as iOS Distribution in TARGETS > Code Signing Identity > Release > Any iOS SDK. When I changed the setting as iOS Developer here, and changed the setting in PROJECTS > Code Signing Identity > Release > Any iOS SDK as iOS Distribution, I've succeeded in archiving. I'm wondering is it necessary to set as iOS Distribution in the target editor or not. And if it's mandatory, please someone let me know how can I work around this error.

My XCode version is 8.1.

Community
  • 1
  • 1
vanagar
  • 3,511
  • 2
  • 10
  • 8
  • 4
    You need to ensure that code signing settings aren't conflicting between the project and the target. – max_ Nov 27 '16 at 01:05
  • 1
    I think I've tried every combination of code signing settings between the project and the target. My problem is in any setting, I cannot get succeeded when I set as iOS `Distribution` in in the Target editor, and I'm wondering if it's necessary. – vanagar Nov 27 '16 at 01:13
  • 1
    @BenLeggiero Please see also https://stackoverflow.com/a/52573190/341994. There is a manual way to clean up, as I explain there. – matt May 03 '19 at 17:16
  • Thanks for the pointer, @matt! That doesn't directly apply to the problem I was working on, since we are making a Mac app and don't use integrations like Game Center. Will bookmark it for later, though! – Ky - May 03 '19 at 17:20

32 Answers32

950

I had this same error, but I had already checked "Automatically manage signing".

The solution was to uncheck it, then check it again and reselect the Team. Xcode then fixed whatever was causing the issue on its own.

Erin Geyer
  • 11,754
  • 1
  • 24
  • 24
  • 16
    Thanks! This worked for me, for anyone who is using cordova to generate an ios platform i was getting this error, even using the latest cordova version. the automatically signing was checked by default but no team selected. it was only when i deselected manage signing and selected auto signing and the team was i able to get this working. thanks Erin! – Jtello May 17 '17 at 13:28
  • 4
    When I check it again , the code signing automatically set iOs Developer but I need to set it iOs Distribution, and when I set it iOs Distribution Xcode through the same exception again as above mentioned. – ami rt Sep 14 '17 at 08:16
  • Where is this automatic thing. I see it, but I don't see an option to enable/disable it. – Mehdi Haghgoo Jun 30 '18 at 17:42
  • Doesn't work. I've been struggling with this for days now. Automatic Signing works perfectly fine when I run the app on my iPhone 8 directly from Xcode. but when I try to archive the app for publishing to App Store, the Profile resolves to NONE. Of course I can manually sign the app but it didn't work, the submitted app gets a different profile and my iCloud container stops working. I've revoked and deleted everything, recreated all certs. and profiles yet no luck. – Nexus Oct 08 '18 at 07:08
  • very frustrating that such silly things made it too time consuming, maybe imp for some project not all – Naga Oct 29 '18 at 14:51
  • 2
    This is right, but to clarify it a little bit more, here is what I experienced: - You have to manually create a Distribution Provisioning Profile (via Apple developer website) beforehand. Automatic Signing doesn't do that for you. - In case the Code Signing Identities in Build Settings were somehow screwed up: all 4 of them have to be set to "iOS Developer" (even the ones for Release) for Automatic Signing to work – jakob.j Nov 11 '18 at 12:39
  • Worked! You saved my evening. Thanks. Not the first time that such obscure phenomena (bugs) appear in Xcode. – CGN Jan 23 '19 at 16:30
  • "close and reopen", the silver bullet solution to modern IT problems – Gianluca Ghettini Feb 06 '19 at 15:54
  • I just updated to the latest Xcode Version10.2.1 and I can confirm that his bug still exists. Also you can still fix it by checking and unchecking said checkbox... – Michael B Apr 26 '19 at 12:25
176

I had the same problem, I noticed that If you want to make a release of your iOs app and publish it on the App Store you don't need at all to put in the "Code Signing Identity" as release, just keep it as iOs developer.

Go to Your project -> Build Settings -> Code Signing Identity and put everything to iOs developer.

enter image description here

Led Machine
  • 7,122
  • 3
  • 47
  • 49
76

For those coming from Ionic or Cordova, you can try the following:

Open the file yourproject/platforms/ios/cordova/build-release.xcconfig and change from this:

CODE_SIGN_IDENTITY = iPhone Distribution
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution

into this:

CODE_SIGN_IDENTITY = iPhone Developer
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer

and try to run the ios cordova build ios --release again to compile a release build.

Reference: https://forum.ionicframework.com/t/ios-build-release-error-is-automatically-signed-for-development-but-a-conflicting-code-signing-identity-iphone-distribution-has-been-manually-specified/100633/7

Charlie Ang
  • 931
  • 7
  • 7
  • 5
    After trying all the other answers, this is the one that finally got it working for me. Thank you! – mikewagz Nov 05 '17 at 14:49
  • 2
    The file is now called **build-release.xcconfig**. You missed one 'c' Here is a bash script to do it: ```` #!/usr/bin/env bash sed -i "" "s/iPhone Distribution/iPhone Developer/g" platforms/ios/cordova/build-release.xcconfig exit 0; ```` – Kent Bull Nov 12 '17 at 23:25
  • @KentJohnson Ah, thanks for the correction. I have updated the answer to refer to the correct filename. – Charlie Ang Nov 13 '17 at 03:30
  • 3
    You can also just comment out the lines; the iPhone Developer setting is set in `build.xcconfig`, these lines just override it. – Jules Nov 15 '17 at 12:47
  • 3
    I simply deleted those two lines and let Xcode automatically manage signing. – Ryan H. Jan 18 '18 at 23:18
  • 4
    You can use the cordova-custom-config plugin to do this automatically with the following lines in config.xml: – Mukul M. Feb 07 '18 at 17:16
  • I noticed the new Ionic 2 instructions don't focus on the --release flag for iOS. Is this even needed anymore? – Dmitri R117 Mar 06 '18 at 09:14
  • I can't possibly imagine WHY this is happening, but it worked for me – Joaquín L. Robles Aug 21 '19 at 16:48
68

You are way over-thinking this. The process is vastly improved and extremely easy in Xcode 8. Take advantage of that fact.

Step One: Do not, in any way, shape, or form, attempt to set the Code Signing settings in the Build Settings. Don't go near them. You will absolutely mess this up. Instead, edit the target and do all the work in the General pane. Best approach: set yourself up for automatic code signing - just enter your Team and check the checkbox, like this:

enter image description here

Step Two: Make sure you have an iOS Distribution Identity (Certificate). You can check this under Xcode Preferences > Accounts, View Details. It would also be a good idea at this time to go to the member center and get yourself an App Store mobile provision for this app, and download and install it.

Step Three: Choose "Generic iOS Device" as your Destination, and choose Product > Archive. The app will be compiled, the archive is created, and you are now ready to submit to the App Store.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Thank you so much! It succeeded. Let me confirm about the Step2: down loading "mobile provision". Is that "iOS Provisioning Profiles (Distribution)"? I just double clicked the downloaded file, and is that the installation that you mentioned here? – vanagar Nov 27 '16 at 04:13
  • Yes, exactly. The downloaded file has now been copied into Xcode's world (you can throw out the original), and will be seen by Xcode when you actually submit to the App Store. – matt Nov 27 '16 at 04:48
  • It may be that under certain circumstances you don't need to make the App Store mobile provision file, because Xcode will create it for you automatically. But I find that it's a good idea to make one anyway. – matt Nov 27 '16 at 19:59
  • Just a note for people trying step 1 : do it for each target you have, that did it for me! :) – Séraphin Hochart Jan 20 '17 at 04:22
  • 2
    It's funny that all the deployment tutorials I've seen tell you to manually change the code signing settings on each target. I had Automatically Manage turned on, but I didn't even realize it. – Dan Feb 14 '17 at 00:33
  • Step One is must if you using Automatic. – Bhavin_m Oct 25 '17 at 11:36
  • Thank you, Matt. I had the additional wrinkle of my app depending upon my framework and discovered that my framework needed to be built properly. @gbk gave me what I needed here: https://stackoverflow.com/questions/33580528/xcode-7-1-swift-framework-app-builds-but-not-archiving – Verticon Feb 21 '18 at 15:02
  • Do we really need to create the provisioning profile in the Apple Developer Portal? The app works anyway, in fact Automatic Signing is supposed to auto create provisioning profiles, according to the docs. – andreszs Jun 25 '18 at 19:34
  • 1
    @andreszs Automatic signing does a good job of creating a development certificate and profile, which is all you need to develop and archive. But when the time comes to distribute to the app store, I find that it's a good idea to create the distribution profile manually and download it, ready to use during the export process. – matt Jul 02 '18 at 21:53
68

If you get this error

App has conflicting provisioning settings. App is automatically signed, but provisioning profile 'ID' has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor, or switch to manual signing in the project editor.

then make sure that you have empty PROVISIONING_PROFILE option in Target Build Settings:

enter image description here

atereshkov
  • 4,311
  • 1
  • 38
  • 49
  • 3
    I did not distinguish between the user and system build profile... so thank you for pointing out that it was "PROVISIONING_PROFILE" – petrosmm Mar 08 '19 at 02:53
  • This was the error I searched for and got the link to this SO question, but this is the answer I needed. Note that trying to actually specify a value of "Automatic" does not work. You need to NOT specify it all despite the error message saying otherwise. For me we are using xcconfig files, so it was was a matter of removing the setting in the config file. – user107172 Jul 30 '19 at 00:32
  • I was struggling against it and this worked, thank you. – Arthur Passos Sep 17 '20 at 12:52
  • Thank you! I had seen this recommendation elsewhere but had been deleting the contents of "Provisioning Profile" under "Signing". Your answer was more specific, and I found a value for "PROVISIONING_PROFILE" had been set under "User-defined" in my Build Settings tab. Deleting that did the trick. – stephen.hanson Oct 14 '20 at 18:52
  • This one helped me, I got complete the project and when I tried to manage the sign I had this issue, then I just go to this above and delete everything in these fields: Debug and Release – clopex Feb 03 '21 at 14:44
38

Don't forget to do this,

Select the Project -- > Build Settings. Search PROVISIONING_PROFILE and delete whatever nonsense is there.

Rein rPavi
  • 3,368
  • 4
  • 22
  • 32
  • 1
    Probably the only solution that did it for me, thanks – Alexander Vitanov Jan 07 '19 at 20:45
  • 4
    I did this, in conjunction with unchecking and re-checking the Automatically manage signing on the General tab and then re-selecting the team. Thanks Rein and Erin. (Hey look at that, your names are anagrams!) – Dave Levy Mar 06 '19 at 15:19
  • Well that's interesting @DaveLevy – Rein rPavi Mar 15 '19 at 05:16
  • I didn't give this much credit because my PROVISIONING_PROFILE didn't seem to contain garbage, it had "Automatic" set and looked fine. Deleting it and re-enabling automatic signing did the trick, though! – Rafael Nobre Aug 19 '19 at 19:47
  • 1
    It's set as "Automatic" and cannot be deleted. – Dror Bar Oct 23 '19 at 14:45
  • 1
    This is the only solution worked for me, after deleting it worked. Thank you. – Ibrahim Azhar Armar Dec 08 '20 at 11:51
  • 1
    For those wondering *how* to delete whatever nonsense is there, you first need to double-click the provisioning profile you want to delete. A small text edit window opens up, then you select all of the text in the text edit window and press the delete key(s) of your choice. Finally, press the key or key to close the text edit window. – Mark A. Durham Jan 14 '22 at 17:29
  • @MarkA.Durham I like it – Rein rPavi Aug 17 '22 at 04:15
23

If you are from Ionic world. You might get a "conflict code signing" error when you in the "archive" stage, as below:

... is automatically signed for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor. Code signing is required for product type 'Application' in SDK 'iOS 10.x'

In this case, please go to Build Settings/under signing, code signing identity, and select both as iOS Developer, not Distribution.

Go to the menu: Product/Archive again, then the issue will be fixed.

George Huang
  • 2,504
  • 5
  • 25
  • 47
  • 2
    The problem is it gets reset every build... This is messing up our automated builds. Any idea how to change this in a non-interactive script ? – Webberig Jul 12 '17 at 06:35
  • 2
    Excellent, this fixed the issue for me. This solution makes perfect sense, in hindsight and with a lot of alcohol consumption. – Steven Kramer Sep 19 '17 at 22:23
19

For those coming from Ionic or Cordova, you can try the following: Disconnect your ios devices from the computer before ios cordova build ios --release (seems to change the targeted device for xcode signing).

Petru
  • 231
  • 2
  • 4
  • 6
    This is the dumbest answer, and it completely works. I hate all of the workarounds we have to do with Xcode to get an app to work. – Jordan Benge Apr 04 '18 at 19:01
  • this is right. When I had my iPad connected instead of my iPhone, I get this error. Once I disconnected all ios devices and build it from command line, it worked fine after that. – Neel May 19 '18 at 11:48
  • Absolutly right. I have been a whole day trying to solve this issue and this is the only solution that works for me. – ulisesvera Jul 05 '18 at 07:38
  • 1
    IOS make me angry.. everything has to be solved through a jiggle.... otherwise thanks dude – Seloka Apr 04 '19 at 12:00
19

The only solution worked for me:

  1. Close Xcode project
  2. Using finder go to project folder
  3. Right click on .xcodeproj and choose "Show Package Contents"
  4. Right click on project.pbxproj go on "Open With" and choose TextEdit
  5. Now search for your Provision Profile instanceId specified in the error message.
  6. Delete all found texts and let Provisioning Profiles clean.
  7. Save & Close
  8. Open Xcode
  9. Enable automatically manage signing

Enjoy! Hope it will be useful!

Gaby Fitcal
  • 1,814
  • 1
  • 17
  • 28
  • 1
    I knew it will be gonna some Xcode issue. Thanks a ton man!!!! It was showing automatic in Build Setting for Provision Profile but still giving that error. Thank god I wasn't the only one with the issue. – Amber K May 23 '19 at 05:54
  • Actually it can be used if you have one developer account and one app, but for many apps, it causes other problems. – goraga1 May 13 '20 at 11:21
15

Go to build settings, search for code signing identity, and set Any iOS SDK value for iOS Developer:

enter image description here

Display Name
  • 4,502
  • 2
  • 47
  • 63
  • 5
    Yeah, that's exactly what the error message asks to do. But could you explain why on earth using "iOS Developer" for release builds would make any sense? – algrid Sep 05 '18 at 15:00
  • strangely this was what worked as well for unity generated project from a while ago – ina Jan 13 '19 at 05:28
11

For me change Code Signing Identity to all iOS Developer for both of Debug and Release.

And Code Signing Style to Automatic.

enter image description here

Tai Le
  • 8,530
  • 5
  • 41
  • 34
10

This worked perfectly for me.

Step 1:

Select the Project Target-- > Build Settings. Search PROVISIONING_PROFILE and delete whatever nonsense is there.

Step 2:

Uncheck "Automatically manage signing", then check it again and reselect the Team. Xcode then fix whatever was causing the issue on its own.

enter image description here

M Murteza
  • 1,629
  • 15
  • 10
8

In my case, i set the "automatic" option in Build Settings.

enter image description here

Emre Gürses
  • 1,992
  • 1
  • 23
  • 28
8

I was struggles long time, I tried all proposed solutions. Nothing work for me.

Then I found the issue: there was a "User Defined Settings" for "PROVISIONING_PROFILE" at the end of Build Settings tab. I delete it for both Project and Target build settings. Then Automatic signing worked perfect.

I hope this will help somebody else. :)

Ahmad.Net
  • 581
  • 5
  • 8
7

Try either of the following

1.Removing and adding ios platform and rebuild the project for ios

ionic cordova platform rm ios
ionic cordova platform add ios
ionic cordova build ios --release

2.Changing the Xcode Build Setting

The solution was to uncheck it, then check it again and reselect the Team. Xcode then fixed whatever was causing the issue on its own.

3.Change the following code in platform

This didn’t make any sense to me, since I had set the project to auto sign in xcode. Like you, the check and uncheck didn’t work. But then I read the last file path given and followed it. The file path is APP > Platforms > ios > Cordova > build-release.xconfig

And in the file, iPhone Distribution is explicitly set for CODE_SIGN_IDENTITY.

Change:

CODE_SIGN_IDENTITY = iPhone Distribution
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution

To:

CODE_SIGN_IDENTITY = iPhone Developer
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer
manish kumar
  • 4,412
  • 4
  • 34
  • 51
7

Find .xcodeproj file and open it with a text editor

Find fields below and make them like this

CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";

PROVISIONING_PROFILE = "";

PROVISIONING_PROFILE_SPECIFIER = "";

codaman
  • 206
  • 4
  • 6
7
  1. General -> Signing -> check automatically manage signing and select team

  2. Build settings -> Signing -> Code Signing Identity -> SET ALL TO "IOS developer"

Nagibaba
  • 4,218
  • 1
  • 35
  • 43
6

Only thing worked for me.

Open the project -> Select your target -> Go to Build Settings -> Search PROVISIONING and delete the selected profiles.

aqsa arshad
  • 801
  • 8
  • 27
2

In my case I had to login to Apple Developer Website and reset the list of devices.

It appears they now require you to do it every year when the subscription is renewed, before being able to add new devices and generate certificates.

Flight
  • 41
  • 8
2

I had the same problem Mine was fixed by searching for "provisioning profile" in the build setting of share extension

Then there was two "Provisioning Profile"s fields there, one regular and one deprecated. The regular one was on Automatic but the deprecated one was not. Changing that one to Automatic too fixed my error.

2

For me, I had dragged the dump_syms binary and a bunch of scripts into my build target when I manually installed the Firebase SDK. Removing those from my target and project solved the issue.

Arman
  • 856
  • 2
  • 10
  • 19
  • Unreal, thank you for pointing to the right direction. More info here: https://stackoverflow.com/questions/41056047/firebase-crash-report-dump-syms-is-not-permitted-in-itunes-connect-upload – Dror Bar Oct 23 '19 at 16:56
2

Using Xcode 10: None of the other solutions here worked for me.

This error appears to be something you can't fix in Xcode 10

I had to revert to Xcode 9 to resolve this issue, and then update back to Xcode 10 so I could run my application on iOS 12 on a non-emulator device.

Any other solutions found on Stack Overflow or elsewhere, used in Xcode 10, sent me into an endless cycle of provisioning conflicts or signing certificate issues. It seems like signing is broken in Xcode 10 whether you're using the automatic method or manually selecting provisioning profiles and certificates.

You can revert to Xcode 9 by first deleting Xcode 10 from your Applications folder. Then, install Xcode 9 using the .xip file listed on this Apple Developers page.

In Xcode 9, use the automatic build option. You may have to uncheck 'Automatically manage signing' and reselect it, and you also may be required to revoke an existing certificate at developer.apple.com.

After you get the app to successfully build in Xcode 9, you can update back to Xcode 10 using the App Store. After reopening the application in Xcode 10, everything still worked. You may not need to do this, but I needed to in order to build for iOS 12 which requires Xcode 10.

Mark Lyons
  • 1,354
  • 6
  • 21
  • 57
2

I opened the project file in a text editor "Atom" then I searched for the provisioning profile id and deleted it.

Khaled Annajar
  • 15,542
  • 5
  • 34
  • 45
1

The problem is in the Cordova settings.

Note this:

iPhone Distribution has been manually specified

This didn’t make any sense to me, since I had set the project to auto sign in xcode. Like you, the check and uncheck didn’t work. But then I read the last file path given and followed it. The file path is APP > Platforms > ios > Cordova > build-release.xconfig

And in the file, iPhone Distribution is explicitly set for CODE_SIGN_IDENTITY.

Change:

CODE_SIGN_IDENTITY = iPhone Distribution
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution

To:

CODE_SIGN_IDENTITY = iPhone Developer
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer

It a simple thing, and the error message does make it clear that iPhone Distribution has been manually specified, but it doesn’t really say where unless you follow the path. I looked and fiddled with xcode for about three hours trying to figure this out. Hopes this helps anyone in the future.

Daniel Muñoz
  • 547
  • 1
  • 7
  • 23
1

Another cordova/ionic possible cause of this is if you're using the common branch-cordova-sdk plugin.

For some reason the plugin was overwriting code signing identities that had been correctly set in build.json when running ionic cordova build ios.

I tracked it down to identities that have been set in /plugins/branch-cordova-sdk/src/scripts/ios/enableEntitlements.js file

Make sure the debug and release vals are both set to "iPhone Developer" and this will save you having to do a manual fix in XCodes Build Settings after every build process

  const DEBUGCODESIGNIDENTITY = "iPhone Developer";
  const RELEASECODESIGNIDENTITY = "iPhone Developer"; // NOT "iPhone Distribution"

This doesn't happen on a different machine with same project/plugin so unsure precise root cause but sharing in case it helps others as this ate up a few hours.

It was found by searching for occurrences of "iPhone Distribution" in the project folder. Do the same to identify any other plugin/library that might be interfering for you.

Wonderbear
  • 63
  • 7
0

Change your code sign in to destribution certificate .

Zahirul Islam
  • 155
  • 2
  • 12
0

After updating to Xcode 8.3.2 i had the same error with a Cordova project. I needed to upgrade Cordova (v7.0.0) and the iOS platform (v4.4.0) for code signing to work.

H. Evers
  • 78
  • 7
0

You need to add a Production Certificate and (or) Download one from your Development Acoount

enter image description here

William Wong Garay
  • 1,921
  • 18
  • 14
0

Please make sure the "Product Bundle Identifier" in Build settings name matches actual bundle identifier.This worked for me.

Saurabh
  • 331
  • 4
  • 12
0

For me, I need to switch from auto to manual, and switch to auto, same error. Switch to manual, and change those provisioning profiles and code signing settings and build and get errors, and switch back to auto, then it just success.

zgjie
  • 2,099
  • 2
  • 21
  • 32
0

I had this same issue. I realized that it was because I was using xcode while I was using it. Since the updates didn't install correctly, it caused these errors to show up. The only thing that fixed it was to quit xcode and reopen it. When I reopened it, it prompted me to install updates. After the updates were installed, the errors went away.

0

I had this problem for a good 3 hours and had to go through so many hoops and was banging my head against a wall for ages.

I had not had this issue previously - my developer certificate allowed me to archive each version and submit to the Appstore. Looking back I have no idea how this was possible, seeing as I never used a distribution profile.

If you are viewing this answer I assume you are wanting to not only develop and archive but also submit to the Appstore.

A couple of things before we begin.

  • Firstly, make sure to download all the correct certificates onto keychain on your mac, this includes both the Developer and Distribution certificates, which can be found at https://developer.apple.com/account/resources/certificates. If you have been transferred a project from someone else. You will need to create a new certificate specific to that project identifier.
  • Secondly, make sure to have downloaded your provisioning profiles for Development and Distribution for the this specific project - this can done in the 'Profiles' tab on the same page where the certificates are downloaded.
  • Thirdly, make your way to (~\Library\MobileDevice\Provisioning Profiles) and delete all the files inside this folder. As well as going to (~\Library\Developer\Xcode\DerivedData) and deleting all the files in there.

Head over to your project's main editor -> project target -> Signing & Capabilities - You should see this screen: Signing & Capabilities Screen

Once you reach this screen, select the debug tab and uncheck the 'Automatically Manage Signing' and select the development profile. Do the same for the release tab and select the distribution profile instead of the development profile.

This now ensures that any future versions have the correct profiles assigned to project.

Chris
  • 92
  • 5