universal: the number of mach-o files is not the same between the arm64 and x64 builds

Hi, thanks for this tool. Unfortunately I cannot create a fat binary because it throws an error. I have two signed app files which I can package without any problems (and then ship the x86 pkg to MAS). When I try to create a fat binary with electron-universal it shows me the error that the mach-o file numbers are not matching. Error: While trying to merge mach-o files across your apps we found a mismatch, the number of mach-o files is not the same between the arm64 and x64 builds

After searching 3 days the internet how to create combined packages with lipo, pkgbuild, productbuild, and pkgutil I have absolutely no idea where to start to get this right. Maybe I can get a hint how to make mach-o files the same number in both apps (I use node_modules/sharp in my project and electron-universal shows a lot of console output before the error appears, seems that there a lot of unique files to each architecture for sharp)

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 15
  • Comments: 15

Most upvoted comments

$ npm init electron-app@latest my-app – --template=vite-typescript

By building a new project with the above commands and executing npx electron-forge make --arch='universal', the same error occurred. After building arm64 and x64 separately, it was found that the arm64 would add the _CodeResources folder. It is suspected to be a problem caused by the signature.

After modifying osxSign, it can work normally.

ref:https://www.electronforge.io/guides/code-signing/code-signing-macos#osxsign-options

Since I haven’t joined the Apple Developer Program, I am unable to verify whether it works properly after configuring the signature. Hope someone can try and give feedback.

Thank you.

with:

npm run package -- --arch=universal

When using osxSign: {}, it compiles but the program just does not run (silent exit crash). When not using osxSign at all, it does not compile:

While trying to merge mach-o files across your apps we found a mismatch, the number of mach-o files is not the same between the arm64 and x64 builds