question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Universal build fails on non-ARM64 hardware, and M1 target DMG is 'damaged'

See original GitHub issue

I’ve got an app which I build hosted in an Electron container, to give me some native/filesystem interop. It works well.

However, for some reason, if I build the M1/ARM64 version (or a Universal build) on GitHub actions, I get a ‘damaged’ DMG file (for the ARM64 build) and an odd Javascript/Node error for the universal build:

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at makeCallback (fs.js:136:11)
at rmdir (fs.js:671:14)
at Promise (internal/util.js:274:30)
at new Promise (<anonymous>)
at rmdir (internal/util.js:273:12)
at MacPackager.doPack (/Users/runner/work/Damselfly/Damselfly/Damselfly.Desktop/node_modules/app-builder-lib/src/macPackager.ts:123:15)

You can see the build failure for the Universal version here. The ARM64 build completes, but the resulting App fails to start, with MacOS saying it’s ‘damaged’.

Building locally on my M1 MacBook pro works fine. My hunch is that the GitHub Actions runners aren’t MacOS ARM64 hardware, so can’t build the M1 versions. But that’s weird, because my understanding is that electron-builder should be able to build ARM64/Universal targets on an Intel Mac (as per this issue. I’m sure it used to work about 3-4 weeks ago, and I haven’t seen any references to Electron build needing to run on M1 hardware to build M1 targets.

I’m using Electron 11.0.0, electron-builder 22.10.4, node 10.24.1. The OS that I’m running this on is 11.4 beta, on an M1 Macbook pro.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:41 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
Keliercommented, Jun 22, 2022

Still an issue

6reactions
Tenpicommented, Nov 8, 2021

Hello, I am experiencing this issue on an M1 Pro MBP running macOS Monterey 12.0.1. All of the apps built for the arm64 architecture are reported as “damaged” when I download from github, but they open when built locally.

Running sudo xattr -r -d com.apple.quarantine "/Applications/myapp.app" resolves the issue, but it’s not user-friendly. I hope that this will get fixed soon, I’ll unfortunately have to stick to building only for x64 architecture.

Read more comments on GitHub >

github_iconTop Results From Across the Web

My app is damaged and can't be opened when porting to M1
I have porting my existing application to support native M1, there a a lot of framework and library that I have already build...
Read more >
したたか企画 on Twitter: "electron-builderでアプリをApple Silicon用 ...
Universal build fails on non-ARM64 hardware, and M1 target DMG is 'damaged' · Issue #5850 ·... I've got an app which I build...
Read more >
Mac ARM64 builds of Electron not working : r/electronjs - Reddit
Does your build fail, or does it give you a DMG that when you install and run on an M1 MacOS says "this...
Read more >
How to Fix a Damaged macOS Installer - MacRumors
To fix the damaged installer, you should just download the installer again. Doing so will also ensure that you have all of the...
Read more >
Running joplin on Apple silicon - Lounge
I found that rebuilding Joplin for this fails, not on Joplin but in Electro… ... I've read that Electron 11.0.0 supports M1 hardware...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found