electron / electron/forge

Unable to generate flatpak file with working application icon

Open
#2,054 1 comment 5 reactions 0 assignees View on GitHub
maker/flatpak platform/linux
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 1h
Merged PRs (30d)
30

Description

### Preflight Checklist
* [x] I have read the [contribution documentation](https://github.com/electron-userland/electron-forge/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project follows, as appropriate.
* [x] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Issue Details

* **Electron Forge Version:**
6.0.0-beta.54
* **Electron Version:**
node_modules/.bin/electron --version
* **Operating System:**
Pop!_OS 20.04 LTS

### Expected Behavior
It should generate a flatpak version of my app with a custom icon set when it is configured correctly.

### Actual Behavior
`electron-forge` makes the flatpak binary without issues, but when running the application it does not display the configured icon. when installing the flatpak binary using `flatpak install` i see the following warning
```
Warning: Not exporting file com.myname.app.png of unsupported type.
```

### To Reproduce
I tried it with different images. PNG versions from 128x128, 512x512,1024x1024. An SVG File, an `icns` file, nothing worked. The generated `deb` file shows the application icon without problems.
This is my `forge.config.js`:
```
const path = require('path')

module.exports = {
packagerConfig: {
icon: path.resolve(
__dirname,
path.join('src', 'assets', 'icons', 'icon.icns'),
),
name: 'myname',
executableName: 'myname',
},
makers: [
{
name: '@electron-forge/maker-deb',
config: {
name: 'myname',
productName: 'myname',
categories: ['Office'],
icon: path.resolve(
__dirname,
path.join('src', 'assets', 'icons', '512x512.png'),
),
},
},
{
name: '@electron-forge/maker-flatpak',
config: {
options: {
id: 'com.myname.app',
name: 'myname',
productName: 'myname',
categories: ['Office'],
icon: path.resolve(
__dirname,
path.join('src', 'assets', 'icons', '512x512.png'),
),
},
},
},
],
plugins: [
[
'@electron-forge/plugin-webpack',
{
mainConfig: './webpack.main.config.js',
renderer: {
config: './webpack.renderer.config.js',
entryPoints: [
{
html: './src/index.html',
js: './src/renderer.js',
name: 'main_window',
},
],
},
},
],
],
}
```

No matter which config i try, it never shows the given icon but this:

Dock:
![image](https://user-images.githubusercontent.com/204190/100123161-82c88800-2e7a-11eb-8a87-921d27f520ed.png)

Applications:
![image](https://user-images.githubusercontent.com/204190/100123653-0c785580-2e7b-11eb-9516-65c1801e04fa.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.