Electron-builder: CSC_NAME is valid, but still getting "no valid identity with this name"

Created on 2 Aug 2016  Â·  11Comments  Â·  Source: electron-userland/electron-builder

  • Version: 5.17.0

  • Target: Mac OSX

I have set up my .bash_profile with the following settings,

export CSC_LINK="file:///x/x/x/Symantic-CodeSigning-Cert.p12"
export CSC_KEY_PASSWORD=""
export CSC_NAME="Talk Fusion Inc. (XXXXXXXXXX)"

When I do an "echo $CSC_NAME" the variables are set correctly, however I still get the following error,

Error: Identity name "Talk Fusion Inc. (XXXXXXXXXX)" is specified, but no valid identity with this name in the keychain
at Object. (/Users/ryanpager/Repositories/talkfusion/desktop/electron-talkfusion/node_modules/electron-builder/src/codeSign.ts:223:13)

Is there another step that I am missing, or is there some way to debug this process?

Thanks!

question

Most helpful comment

Nevermind... I removed CSC_LINK CSC_KEY_PASSWORD and CSC_NAME from the NPM script and now it works.

😮

All 11 comments

CSC_NAME is not required.

Please attach here result:

security find-identity -v

If you build on local machine, just import cert into your keychain and nothing more.

 1) 8D6FC388D673F1C839EB023DCDE060B1D51EE492 "com.apple.idms.appleid.prd.6c6f4e4355567647304f3543656a44693249733456773d3d"
2) 6ED4826E23C7619227C4125426E0E1A1DE5770AC "Mac Developer: Ryan Page (XXXXXXXXXX)"
3) C6554054DB07945E1809CC8A748F944368FE2FE7 "3rd Party Mac Developer Installer: Talk Fusion Inc. (XXXXXXXXXX)"

Cert Developer ID Application: *** is missed, please fix it and try again.

@develar I downloaded the cert from my account and added it to the keychain but it doesnt seem to want to show up. Is there an alternate way to get this to show up?

(Thanks for the quick responses btw, really appreciate it.)

@ryanpager You cannot just download cert — you must provide not only cert (public key), but private key — due to security reasons private key is not stored on Apple servers. Please see https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html#//apple_ref/doc/uid/TP40012582-CH31-SW6 Creating Signing Identities

To sign app for macOS you need to create Developer ID Application.

@develar Thanks, took a while to get everything squared away but it works great.

Side question -- is there a way I can run this locally (through electron command) where it will recognize the signing identity -- I wanted to test my auto updater stuff. Thanks!

On your local machine identity will be discovered automatically (I assume your keychain contains certs). Or you can sign using CSC_LINK as on CI server. I don't see any problem here.

is there a way I can run this locally (through electron command) where it will recognize the signing identity

If you mean run app using electron (electron-prebuilt) — no. It is not possible. Just build your app and debug it.

@develar can you explain how to get the Developer ID Application?

I followed the steps in the Apple docs for Creating Signing Identities but the button is greyed out...

image

Nevermind... I removed CSC_LINK CSC_KEY_PASSWORD and CSC_NAME from the NPM script and now it works.

😮

Once I had my Mac Developer key, I was also able to unset the CSC_* environment variables and get a build out. Confusing.

For anyone having the greyed out button problem in Xcode remember that you need to login with the Apple account of the owner, not a team member. Even if such team member is an admin it won't work.

Was this page helpful?
0 / 5 - 0 ratings