forge: MacOS: code has no resources but signature indicates they must be present
Pre-flight checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project uses.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Electron Forge version
6.0.4
Electron version
v22.0.0
Operating system
macOS Ventura (ARM)
Last known working Electron Forge version
last beta version
Expected behavior
codesign --verify --deep --strict out/MyApp-darwin-arm64/MyApp.app # should output:
/Users/wyattblue/projects/app/out/MyApp-darwin-arm64/MyApp.app: code object is not signed at all
Actual behavior
codesign --verify --deep --strict out/MyApp-darwin-arm64/MyApp.app # should output:
/Users/wyattblue/projects/app/out/MyApp-darwin-arm64/MyApp.app: code has no resources but signature indicates they must be present
Steps to reproduce
Run yarn package on a skeleton project on MacOS Arm
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (5 by maintainers)
For anyone that finds this in the future. Here’s how I fixed this (after 10 hours of debugging):
Fill in the blanks with the values from:
security find-identity -p codesigning -v.I did some testing, and the found that the problem is with
osx-electron-signitself. I had to specifyidentitywith my Apple Developer account, since it complains about not finding a valid identity but it’s now working for me!One thing you can do on your end is document the fact that signing takes place before the
postPackagehooks so any code that minifies or removes files will invalidate the sign. I had to move that code to thepackageAfterCopyhook. Here’s theforge.config.jsI’m usingI consider this issue resolved on electron-forge’s end.
Seems to be happening still, I followed the guide on Electron Forge, but get the error when running package or make commands.
I had this exact same issue resulting in notarization failure with:
I had to add the sign identity specifically to the config. In this case the docs on the site were misleading and it failed without any error, only finally failing at the notarize step.
Not sure if these issues are related:
In my case, it was lack of these two certifacation:
Developer ID - G2 (Expiring 09/17/2031 00:00:00 UTC) Apple Inc. Root
download from apple official site: https://www.apple.com/certificateauthority/
Install these two first, then install your developer certifacation.
Noted. We should definitely document the package flow a bit better I think.