develar / app-builder

Generic helper tool to build app in a distributable format
MIT License
122 stars 62 forks source link

Problems building for arm64 Raspberry - Icons Related. #59

Open marceloch2 opened 3 years ago

marceloch2 commented 3 years ago

Target

Building my Electron app inside a RaspberryPi 4 ARM64 it fails while copying and/or converting my icons inside resources/icons and crashes with a message that is not very clear.

snapcraft is not installed, please: sudo snap install snapcraft --classic

More logs with the error that Can say more about the app-builder-bin failing with the icons part.

• exited          command=app-builder code=0 pid=9793
  • packaging       platform=linux arch=arm64 electron=13.1.2 appOutDir=release/linux-arm64-unpacked
  • spawning        command=/root/countr-desktop-next/node_modules/app-builder-bin/linux/arm64/app-builder unpack-electron --configuration [{"platform":"linux","arch":"arm64","version":"13.1.2"}] --output /root/countr-desktop-next/release/linux-arm64-unpacked --distMacOsAppName Electron.app
  • map async       taskCount=2
  • map async       taskCount=1
  • map async       taskCount=73
  • exited          command=app-builder code=0 pid=10276
  • building        target=snap arch=arm64 file=release/countr-desktop_4.0.1_arm64.snap
  • spawning        command=/root/countr-desktop-next/node_modules/app-builder-bin/linux/arm64/app-builder icon --format set --root /root/countr-desktop-next/resources --root /root/countr-desktop-next --out /root/countr-desktop-next/release/.icon-set --input icons/ --fallback-input /root/countr-desktop-next/node_modules/app-builder-lib/templates/icons/electron-linux
  • path resolved   path=/root/countr-desktop-next/resources/icons outputFormat=set
  • map async       taskCount=8
  • exited          command=app-builder code=0 pid=10283 out={"icons":[{"file":"/root/countr-desktop-next/resources/icons/24x24.png","size":24},{"file":"/root/countr-desktop-next/resources/icons/32x32.png","size":32},{"file":"/root/countr-desktop-next/resources/icons/48x48.png","size":48},{"file":"/root/countr-desktop-next/resources/icons/64x64.png","size":64},{"file":"/root/countr-desktop-next/resources/icons/96x96.png","size":96},{"file":"/root/countr-desktop-next/resources/icons/128x128.png","size":128},{"file":"/root/countr-desktop-next/resources/icons/256x256.png","size":256},{"file":"/root/countr-desktop-next/resources/icons/512x512.png","size":512}],"isFallback":false}
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  • spawning        command=/root/countr-desktop-next/node_modules/app-builder-bin/linux/arm64/app-builder snap --app /root/countr-desktop-next/release/linux-arm64-unpacked --stage /root/countr-desktop-next/release/__snap-arm64 --arch arm64 --output /root/countr-desktop-next/release/countr-desktop_4.0.1_arm64.snap --executable countr-desktop --icon /root/countr-desktop-next/resources/icons/512x512.png --extraAppArgs=--no-sandbox
  • copy files      from=/root/countr-desktop-next/resources/icons/512x512.png to=/root/countr-desktop-next/release/__snap-arm64/snap/gui/icon.png isUseHardLinks=true
  • exit status 1   
  ⨯ snapcraft is not installed, please: sudo snap install snapcraft --classic  
  • exited          command=app-builder code=1 pid=10288
  • async task error  error=/root/countr-desktop-next/node_modules/app-builder-bin/linux/arm64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
  ⨯ /root/countr-desktop-next/node_modules/app-builder-bin/linux/arm64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  stackTrace=
                                                                                                                                           Error: /root/countr-desktop-next/node_modules/app-builder-bin/linux/arm64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
                                                                                                                                               at ChildProcess.<anonymous> (/root/countr-desktop-next/node_modules/builder-util/src/util.ts:243:14)
                                                                                                                                               at Object.onceWrapper (events.js:483:26)
                                                                                                                                               at ChildProcess.emit (events.js:376:20)
                                                                                                                                               at maybeClose (internal/child_process.js:1055:16)
                                                                                                                                               at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! countr-desktop@4.0.1 package-pi: `yarn build && electron-builder build --linux --arm64 --publish never

File Package.json - Build section

"build": {
    "buildDependenciesFromSource": true,
    "productName": "Countr-Desktop",
    "appId": "com.en.countr.desktop",
    "compression": "normal",
    "files": [
      "resources/**/*",
      "app/img/",
      "app/dist/",
      "app/app.html",
      "app/main.prod.js",
      "app/main.prod.js.map"
    ],
    "linux": {
      "target": {
        "target": "snap",
        "arch": "arm64"
      },
    },
    "directories": {
      "buildResources": "resources",
      "output": "release"
    }
  }
marceloch2 commented 3 years ago

The command that doesn't work is:

/root/countr-desktop-next/node_modules/app-builder-bin/linux/arm64/app-builder snap --app /root/countr-desktop-next/release/linux-arm64-unpacked --stage /root/countr-desktop-next/release/__snap-arm64 --arch arm64 --output /root/countr-desktop-next/release/countr-desktop_4.0.1_arm64.snap --executable countr-desktop --icon /root/countr-desktop-next/release/.icon-set/icon_256.png --extraAppArgs=--no-sandbox

And I can confirm the icon icon_256.png is there, tried with different images and formats but the same problem sadly.

LoveCodingOnGithub commented 2 years ago

@marceloch2 Same problem here :( have you solved it ?

cheynewallace commented 9 months ago

Anyone solve this? im hitting this issue right now also