Codesign returned unknown error -1=ffffffffffffffff

后端 未结 8 1386
傲寒
傲寒 2020-12-02 23:43

I tried to code sign an iOS application, These are the steps that i followed

    security create-keychain -p password ${KEYCHAIN}
    security set-keychain-s         


        
相关标签:
8条回答
  • 2020-12-03 00:00

    This happens in a headless build because the prompt for key access cannot be shown or responded to. The solution is to prevent that prompt from showing by granting access to the key in advance.

    Open Keychain Access, find the key for your signing certificate (login-> Certificates, then expand the certificate to reveal its key). Right-click on the key and select: Get Info -> Access Control, and select "Allow all applications to access this item".

    0 讨论(0)
  • 2020-12-03 00:00

    I've tried almost all the existing suggestions over the web, none of them helped...

    Finally only re-generating the Provisioning Profile (for AdHoc), re-downloading it and placing it to ~/Library/MobileDevice/Provisioning Profiles/ overwriting the existing one saved my life.

    By the way, AppStore build was successful all this time, so the issue was definitely in the AdHoc profile itself (pretty strange, since it looked nice by all means).

    0 讨论(0)
  • 2020-12-03 00:06

    Even though we installed the right certs in the keychain and the right Provisioning Profile under ~/Library/MobileDevices/Provisioning Profiles.

    We may also see

    unknown error -1=ffffffffffffffff
    

    For this error, I tried the below steps to fixed the issue:

    1. Reboot the machine, unlock keychain using "securify unlock-keychain", lock the keychain again
    2. Remove ~/Library/Developer/Xcode/DerivedData folder.
    3. Run carthage bootstrap --platform iOS
    4. Open the source code syncing down workspace, run "xattr -rc ." then open the .xcodeproject file in xcode.
    5. Turned on the automatic signing for each target. Need to login with valid credentials.
    6. Click on the provisioning profile under signing.
    7. unlock the keychain again
    8. Changing the build device to Generic Devices, under Product --> Clean, then Product –> Archive
    9. There will be a keychain access allow showed up, click "Always Allow".
    10. You should make sure the archive is successful then trigger the Jenkins job again.
    0 讨论(0)
  • 2020-12-03 00:09

    You might have exported some file like p12 from KeyChain, and when OS asked for your root password, and you denied it, then Xcode will code sign error with this info.

    If this maybe so, you should repeat the above action, input your password and click allow, and then it will be ok to code sign.

    0 讨论(0)
  • 2020-12-03 00:13

    I am going to chip in as well as I had to try a few more things than the ones mentioned here: the problem was that keychain doesn't like SSH sessions. I had to execute these in my session to fix it:

    security unlock-keychain -p MY_PASS ~/Library/Keychains/login.keychain
    security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k MY_PASS ~/Library/Keychains/login.keychain
    security set-keychain-settings ~/Library/Keychains/login.keychain
    

    I've also removed my current certificates system/account certificates by removing my account from XCode (I use fastlane to do building) but I suspect that this shouldn't have impacted it.

    0 讨论(0)
  • 2020-12-03 00:14

    Had the same problem a while ago, adding

    security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k password ${KEYCHAIN}

    solved it for me.

    0 讨论(0)
提交回复
热议问题