Xcode attempted to locate or generate matching signing assets and failed to do so

39,966

Solution 1

I'm also facing this issue as a 'Team Member' role. The 'You are not allowed to perform this operation' warning leads me to believe that XCode is more strictly enforcing the roles defined here: https://developer.apple.com/programs/roles/

Even though I have access to the signing assets (certificate and provisioning profile), XCode won't allow me to specify them. Try upgrading your role to Team Admin.

Updated 2014-09-29: After extensive research, I've found it is possible to generate the .ipa using xcodebuild from the command line even as a 'Team Member' role using the following:

xcodebuild -exportArchive -archivePath $projectname.xcarchive -exportPath $projectname -exportFormat ipa -exportProvisioningProfile "Provisioning Profile Name"

credit to 1

Note: As pointed out in the linked article, the "Provisioning Profile Name" is the name specified in the name field of the certificate (viewable from developer.apple.com).

You can automate the process in xcode by including the call into your project build script.

Solution 2

Try to open your console and go to your Xcode project folder then type these commands:

to clean your project

xcodebuild clean -project YourProjectName.xcodeproj -configuration Release -alltargets

to build and archive your app

xcodebuild archive -project YourProjectName.xcodeproj -scheme YourSchemaName -archivePath YourProjectName.xcarchive

You can simply find YourSchemaName in Xcode > Product > Scheme > Edit Scheme...

finally to create your app .ipa file

xcodebuild -exportArchive -archivePath YourProjectName.xcarchive -exportPath YourProjectName -exportFormat ipa -exportProvisioningProfile 'Your Provisioning Profile Name'

To find Your Provisioning Profile Name please login to Apple Developer Member Center and go to Certificates, Identifiers & Profiles, then click on Provisioning Profiles for iOS Apps. There you will find Your Provisioning Profile Name.

If it does not work try to replace single quote with double one ( ' with " ).

You will find .ipa file in your Xcode project folder.

After this you will able to open your .ipa file in iTunes and install on your iOS device.

I hope it helps!

Solution 3

What's happening: Xcode need to sign build with valid Certificate. It is trying to locate one with no luck. Why? Because before Xcode6, you were allowed to sign AdHoc builds with your's developer certificate. And you were able to, because you have a private key for it. But now you need to sign Ad Hoc builds with Production Certificate. And you don't have a private key for it.

So steps required to make it possible to build from Xcode6 (https://stackoverflow.com/a/26061067/1918302):

  1. Get a private key for your Production Certificate. (You need to export it from Mac keychain it has and import to your's keychain OR Revoke current and Create New production certificate. During creation you'll get one. Quoting here from link above:

    BEWARE: revoking an enterprise distribution certificate invalidates all apps that were signed and deployed with that certificate (official info)).

  2. Create special XC Ad Hoc: Distribution provisioning profile (if you have Admin role in your team on developer.apple.com - Xcode will do this for you).

  3. Set provisioning profile in your project's target -> Build Settings -> Code Signing to this created in step 2.

Done!

OR if those above not achievable, you can make a build using command line tools: https://stackoverflow.com/a/25979784/1918302. But this seems to me as security hole and I don't believe that this will work for long time.

Solution 4

For me, it turned out the cause of this was I had not set the project's provisioning profile property as per this answer.

Solution 5

We were able to work around this problem by simply having one of the admins download the "XC Ad Hoc: Distribution" profile from the dev center, then sending it to the "Team Member" who wanted to build, and letting him manually import it. Since he already had the cert, this was all he needed to be able to do the build and stop getting this error. Existing answers here are correct, but this is a low-friction way to get the last piece of the puzzle for many of us.

In summary, you need this profile and the cert with a private key in your keychain.

Share:
39,966
liquidpenguins
Author by

liquidpenguins

Developer/Designer at Liquid Penguins

Updated on April 18, 2020

Comments

  • liquidpenguins
    liquidpenguins about 4 years

    So I'm trying to create an ad-hoc build using existing provisioning profile (that worked before) with Xcode 6.0.1 on Mavericks, but after trying to export this archive, I keep getting the following error:

    Do I need to re-create my certificates and provisioning profiles, or is there a better solution? Thanks!

  • Eva Madrazo
    Eva Madrazo over 9 years
    mmmm with what role are you signed? Developer?
  • Igor Konoplyanko
    Igor Konoplyanko over 9 years
    yes, not as admin. But after i've logged in with admin account, I could sign both from admin and mine. Strange stuff...
  • John G
    John G over 9 years
    Oh wow this tip (using command line) just saved my bacon so thanks so much! And yes just copy and paste the prov profile name as it appears in dev portal. Don't use the filename of that exported profile.
  • Eva Madrazo
    Eva Madrazo over 9 years
    try to fix xcode with this: github.com/thecodepath/ios_guides/wiki/Fixing-Xcode very useful when weird behaviour happens.
  • Christoph
    Christoph over 9 years
    Thanks a lot for sharing :)
  • Alix
    Alix over 9 years
    This is amazing. I am not sure failed validation is gonna cause problem when user install it from server. Still most satisfactory answer to the problem.
  • Andre Cytryn
    Andre Cytryn over 9 years
    Where can I get the .xarchive file? I have already archived my project but cant seem to find any on my project folder
  • Tico Ballagas
    Tico Ballagas over 9 years
    To find the .xcarchive, right click on the archive in the 'Organizer' window and select 'Show in Finder'. Drag the file into a terminal window to quickly get a full path string.
  • masonk
    masonk over 9 years
    I added my production certificate to the keychain based on this answer and was able to sign again. Thank you.
  • bucherland
    bucherland over 9 years
    Cool, happy this helped.
  • patschiboy
    patschiboy almost 9 years
    Frustrating that you create the IPA file successfully via the command line (the above worked perfectly for me!), but XCode confuses you with an error message that doesn't make any sense.
  • Logic
    Logic over 8 years
    will it be corrupted IPA or OK ?
  • Markus
    Markus over 8 years
    This should have more upvotes since it's working perfectly, thank you man!
  • Joncom
    Joncom over 8 years
    For me it was the other way around. I had the distribution provisioning profile, but I needed a distribution certificate so I could sign the app to upload to the App Store. Checking my keychain, I saw that I was missing the distribution private key, so I had someone send it to me which resolved the OP's original error message.
  • Brandon A
    Brandon A about 7 years
    "--- xcodebuild: WARNING: -exportArchive without -exportOptionsPlist is deprecated"