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.

including build/icons/icon.png causes build to fail

See original GitHub issue

Describe the bug Build fails when including icon.png. I tried upgrading to electron-builder@next and it did not make a difference.

To Reproduce Steps to reproduce the behavior:

  1. npm run electron:build

Expected behavior The build should succeed when an icon is including at builds/icons/icon.png.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):


Environment Info:

  System:
    OS: macOS 11.2.1
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 15.8.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.14.11 - ~/.npm/bin/npm
  Browsers:
    Chrome: 88.0.4324.150
    Edge: Not Found
    Firefox: 82.0.2
    Safari: 14.0.3
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1 
    @vue/babel-helper-vue-transform-on:  1.0.2 
    @vue/babel-plugin-jsx:  1.0.2 
    @vue/babel-plugin-transform-vue-jsx:  1.2.1 
    @vue/babel-preset-app:  4.5.11 
    @vue/babel-preset-jsx:  1.2.4 
    @vue/babel-sugar-composition-api-inject-h:  1.2.1 
    @vue/babel-sugar-composition-api-render-instance:  1.2.4 
    @vue/babel-sugar-functional-vue:  1.2.2 
    @vue/babel-sugar-inject-h:  1.2.2 
    @vue/babel-sugar-v-model:  1.2.3 
    @vue/babel-sugar-v-on:  1.2.3 
    @vue/cli-overlay:  4.5.11 
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.11 
    @vue/cli-plugin-eslint: ~4.5.0 => 4.5.11 
    @vue/cli-plugin-router: ~4.5.0 => 4.5.11 
    @vue/cli-plugin-unit-mocha: ~4.5.0 => 4.5.11 
    @vue/cli-plugin-vuex: ~4.5.0 => 4.5.11 
    @vue/cli-service: ~4.5.0 => 4.5.11 
    @vue/cli-shared-utils:  4.5.11 
    @vue/component-compiler-utils:  3.2.0 
    @vue/eslint-config-airbnb: ^5.0.2 => 5.3.0 
    @vue/preload-webpack-plugin:  1.1.2 
    @vue/test-utils: ^1.1.3 => 1.1.3 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^6.2.2 => 6.2.2 
    vue: ^2.6.11 => 2.6.12 
    vue-cli-plugin-electron-builder: ~2.0.0-rc.6 => 2.0.0-rc.6 
    vue-cli-plugin-vuetify: ^2.1.0 => 2.1.0 
    vue-eslint-parser:  7.4.1 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  15.9.6 (16.1.2)
    vue-router: ^3.2.0 => 3.5.1 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.11 => 2.6.12 
    vue-template-es2015-compiler:  1.9.1 
    vuetify: ^2.4.4 => 2.4.4 
    vuetify-loader: ^1.7.2 => 1.7.2 
    vuex: ^3.4.0 => 3.6.2 
  npmGlobalPackages:
    @vue/cli: 4.5.11

Additional context Add any other context about the problem here.

Building app with electron-builder:
  • electron-builder  version=22.10.4 os=20.3.0
  • writing effective config  file=dist_electron/builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=sqlite3@5.0.1 platform=darwin arch=x64
  • packaging       platform=darwin arch=x64 electron=11.2.3 appOutDir=dist_electron/mac
panic: runtime error: index out of range [-1]

goroutine 1 [running]:
github.com/develar/app-builder/pkg/icons.doConvertIcon(0xc0000eb480, 0x3, 0x4, 0xc00026eb60, 0x2, 0x2, 0x7ffeefbfd931, 0x4, 0x7ffeefbfd98c, 0x36, ...)
        /Volumes/data/Documents/app-builder/pkg/icons/icon-converter.go:220 +0x1165
github.com/develar/app-builder/pkg/icons.ConvertIcon(0xc0000eb380, 0x97, 0x0, 0x292946b200000000)
        /Volumes/data/Documents/app-builder/pkg/icons/icon-converter.go:56 +0xd6
github.com/develar/app-builder/pkg/icons.ConfigureCommand.func1(0xc000249710, 0x100d485, 0x1831b60)
        /Volumes/data/Documents/app-builder/pkg/icons/icon-converter.go:33 +0x7f
github.com/alecthomas/kingpin.(*actionMixin).applyActions(0xc000138e58, 0xc000249710, 0x0, 0x0)
        /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/actions.go:28 +0x6d
github.com/alecthomas/kingpin.(*Application).applyActions(0xc0000fe780, 0xc000249710, 0x0, 0x0)
        /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:557 +0xdc
github.com/alecthomas/kingpin.(*Application).execute(0xc0000fe780, 0xc000249710, 0xc00021f210, 0x1, 0x1, 0x0, 0x0, 0x0, 0x150abc5)
        /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:390 +0x90
github.com/alecthomas/kingpin.(*Application).Parse(0xc0000fe780, 0xc0000d4010, 0x9, 0x9, 0xc0000fe780, 0xc00009e058, 0x0, 0x0)
        /Volumes/data/go/pkg/mod/github.com/alecthomas/kingpin@v2.2.6+incompatible/app.go:222 +0x213
main.main()
        /Volumes/data/Documents/app-builder/main.go:90 +0x2c5
ExecError: /Users/michael/Dev/trader-bot/node_modules/app-builder-bin/mac/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
    at ChildProcess.<anonymous> (/Users/michael/Dev/trader-bot/node_modules/builder-util/src/util.ts:243:14)
    at Object.onceWrapper (node:events:485:26)
    at ChildProcess.emit (node:events:378:20)
    at maybeClose (node:internal/child_process:1067:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
  exitCode: 2,
  alreadyLogged: true,
  code: 'ERR_ELECTRON_BUILDER_CANNOT_EXECUTE'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
mafischercommented, Feb 14, 2021

@timenz Thanks for that suggestion. With only icon.png and or icon.icns the build would always fail. When adding the below files in addition to those above, the build did succeed:

icon_128x128.png	icon_256x256.png	icon_512x512.png
icon_128x128@2x.png	icon_256x256@2x.png	icon_512x512@2x.png
icon_16x16.png		icon_32x32.png
icon_16x16@2x.png	icon_32x32@2x.png

At the very least this is an issue with the documentation, although It seems as though it is a bug.

1reaction
timenzcommented, Feb 14, 2021

Got the same issue, but I working with windows, try to rename the icon that contain its file size, something like

build/icons/512x512.png

resolve the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with Icon.png (Icon specified in the Info.plist not found ...
For me, the archive was missing Icon.png file for some reason. The archive utility has a bug. I moved the icons out of...
Read more >
Build failure because of... App Icons ?! - ionic-v1
Hi :slight_smile: I've an error when I build my app. I'm on Mac, and with the ionic build ios command, I've these errors...
Read more >
mergeReleaseResources FAILED, failed to read PNG signature
On SAB 6.2, Win10, I've got a failure error for mergeReleaseResources, saying it failed to read the PNG signature for my icons.
Read more >
Oh dear! Build errors? - LoopDocs - GitHub Pages
Yellow and Purple warnings do not cause the build to fail, those are just warnings. You will often see yellow and purple icons....
Read more >
flutter_launcher_icons | Dart Package - Pub.dev
icon /path/here.png : This will generate a new launcher icons for the platform with the name you specify, without removing the old default...
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