Xcode attempted to locate or generate matching sig

2019-01-21 00:52发布

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!

9条回答
够拽才男人
2楼-- · 2019-01-21 01:23

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.

查看更多
对你真心纯属浪费
3楼-- · 2019-01-21 01:27

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!

查看更多
再贱就再见
4楼-- · 2019-01-21 01:29

I was also receiving this error because the Developer Certificate for the machine I was building on had expired.

Even after renewing that certificate, I was unable to Export the Build for App Store release. Even after following the instructions in the accepted answer and upgrading that Developer account to an admin.

It turns out, that because the Archive was created while that Developer Certificate was expired, that Developer was unable to codesign using the Distribution Profile. I had to recreate the Archive, after renewing the Developer Certificate, for that machine to be allowed to use the Distribution Certificate (already installed and previously working) to be allowed to codesign the new archive and upload to app store.

Sharing in case anyone else hits this edge case.

查看更多
登录 后发表回答