Fabric Plugin: Archive Packaging Error: -6 Error re-signing the application for distribution

Viewed 6118

When I try to upload a new build using the Fabric Plugin I get the following error:

Archive Packaging Error: -6 Error re-signing the application for distribution.

/usr/bin/codesign --sign 937558639C8878BB6E161112505FA2965804A6AE --all-architectures --force --entitlements
/var/folders/xf/l7r1f0m54mjbwd9c3myd88zw0000gn/T/com.crashlytics.ipas/A6C80578-CC0E-443D-B81C-C10E972E88F8/Payload/entitlements.xml 
/var/folders/xf/l7r1f0m54mjbwd9c3myd88zw0000gn/T/com.crashlytics.ipas/A6C80578-CC0E-443D-B81C-C10E972E88F8/Payload/ShowGo.app

937558639C8878BB6E161112505FA2965804A6AE: no identity found

It used to work until the last version of the app. And then for some reason it just stopped working. Here's what I've tried:

  • Clean / Rebuild / Archive (many times)
  • Uninstall / reinstall Fabric plugin
  • Re-download provisioning profiles
  • Change from automatic to manual signing
  • Searching for missing code signing identity (> security find-identity -p codesigning)

What's killing me is I can't figure out for the life of me where Fabric is pulling that codesign identity value (937558639C8878BB6E161112505FA2965804A6AE) from. It's not in the project as I've grepped for it. Could it be cached somewhere else?

13 Answers

I've had the same issue.

enter image description here

It's because your developer account is prolongated and Provision Profiles are invalid.

enter image description here

You need to go to the developer.apple.com and update your Provision Profiles. Then download them, delete old Provision Profiles from Xcode, and tap to the new Profiles for add it to the Xcode! It helped me!

Archive Packaging Error: -6 Error re-signing the application for distribution

I finally manage to upload a debug archive into Fabric (plugin) via XCode (not fastlane) by manually set an 'iPhone Distribution' certificate in 'xcode/build settings/code signing identity/debug' as well as an adhoc provisioning profile in 'xcode/build settings/Provisioning profile/debug' instead of the 'iPhone developper certificate' and 'Debug provisionning profile' ones (both on app, widget and rich push extensions)

Here's how I solved this issue.

First, I quit XCode and opened up my provisioning profiles by going to Library/MobileDevice/Provisioning Profiles. By selecting each profile and hitting space to preview it, you can see all the certificates associated with the provisioning profile and each of their SHA-1 values. That's what this codesign identity value is — the SHA-1 of the certificate.

Then I opened up Keychain Access and found that I had two copies of that same certificate in my login keys, so I deleted both and reinstalled the cert. You can do this by going to the Apple Developer portal, redownloading the certificate, and just double clicking it. You can check to make sure it really is there by once again opening up Keychain Access.

Upon reopening XCode, I hard cleaned and deleted the Fabric cache just for good measure. Then, finally, it worked.

I have a workaround:

  • On Xcode:

    • Build
    • Go to Menu Products/ Archive
      • Distribuite App:
        • Ad hoc
          • Export
            • No Bitcode or Symbols
            • Automatic signing
            • Save the kscanner.ipa location
  • On the command line:

    /path/to/Crashlytics.framework/submit \ -ipaPath /path/to/my.ipa -emails TestEmail@fabric.io,AmazingTester@google.com \ -notesPath ~/Notes/ReleaseNotes.txt \ -groupAliases GroupAlias,GroupAlias2 \ -notifications YES

Use DISTRIBUTION Ad Hoc provisioning profile. Development provisioning profile will generate this error.

The error says: Archive Packaging Error: -6 Error re-signing the application for distribution.

If you use a distribution instead of development, the Fabric app will not need to re-sign your app.

Also make sure to download the active provisioning profile at: https://developer.apple.com/account/ios/profile/production

I might be late in answering however below solution worked for me on Xcode 9 later Go To Finder and redirect to this path ~/Library/MobileDevice/Provisioning Profiles. Then delete all the profiles and Click on Xcode, it will re download required certificates and provisioning profiles.

Enjoy

I had this issue after my old "iPhone Developer: Developer Name" certificate expired. I already had "Apple Development: Developer Name" certificate in the keychain which should have been used instead. Deleting the expired certificate in Keychain Access fixed the issue.

Related