Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred while making for target: flatpak #2561

Open
3 tasks done
zigazajc007 opened this issue Oct 4, 2021 · 17 comments
Open
3 tasks done

An error occurred while making for target: flatpak #2561

zigazajc007 opened this issue Oct 4, 2021 · 17 comments

Comments

@zigazajc007
Copy link

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.0.0-beta.61

Electron version

15.0.0

Operating system

Zorin OS and POP OS 21.04 -> Doesn't work on any of those OS.

Last known working Electron Forge version

Never

Expected behavior

Be able to create flatpak file.

Actual behavior

I have flatpak, flatpak-builder and also elfutils (eu-strip) installed.
It provide me with an error:

✖ Making for target: flatpak - On platform: linux - For arch: x64

An unhandled error has occurred inside Forge:
An error occured while making for target: flatpak
flatpak failed with status code 1
Error: flatpak failed with status code 1
    at ChildProcess.<anonymous> (/home/ziga/Documents/Projects/Passky/Passky-Desktop/node_modules/@malept/flatpak-bundler/index.js:71:16)
    at ChildProcess.emit (node:events:390:28)
    at ChildProcess.emit (node:domain:475:12)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

Steps to reproduce

  1. Clone repository: https:/Rabbit-Company/Passky-Desktop

  2. Add "@electron-forge/maker-flatpak": "^6.0.0-beta.61" to devDependencies in package.json file

  3. Add this json code to js/forge.config.js file:

     {
        "name": '@electron-forge/maker-flatpak',
        "config": {
          "options": {
            "categories": ['Utility']
          }
        }
      }
  1. Run npm i to install all dependencies

  2. Than run npm run make.

Result of npm run make:

> [email protected] make
> electron-forge make

✔ Checking your system
✔ Resolving Forge Config
We need to package your application before we can make it
✔ Preparing to Package Application for arch: x64
✔ Preparing native dependencies
✔ Packaging Application
Making for the following targets: deb, rpm, flatpak
✔ Making for target: deb - On platform: linux - For arch: x64
✔ Making for target: rpm - On platform: linux - For arch: x64
✖ Making for target: flatpak - On platform: linux - For arch: x64

An unhandled error has occurred inside Forge:
An error occured while making for target: flatpak
flatpak failed with status code 1
Error: flatpak failed with status code 1
    at ChildProcess.<anonymous> (/home/ziga/Documents/Projects/Passky/Passky-Desktop/node_modules/@malept/flatpak-bundler/index.js:71:16)
    at ChildProcess.emit (node:events:390:28)
    at ChildProcess.emit (node:domain:475:12)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

Additional information

No response

@zigazajc007 zigazajc007 added the bug label Oct 4, 2021
@WhizzoCode
Copy link

Same here in Fedora 34

@Kurtoid
Copy link

Kurtoid commented Nov 4, 2021

Reproduced w/ Arch latest

@TheIceCreamBear
Copy link

TheIceCreamBear commented Nov 4, 2021

Im getting the same issue on Ubuntu 20.04 with very similar steps and electron version 15.1.1

@Progdrasil
Copy link

seems similar to #1702

@jochy
Copy link

jochy commented Feb 12, 2022

I got the same issue. I managed to make it work by installing some flatpaks things :

sudo apt install flatpak flatpak-builder elfutils
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak install flathub org.freedesktop.Platform//21.08 org.freedesktop.Sdk//21.08 -y
sudo flatpak install flathub org.freedesktop.Platform/x86_64/19.08 org.freedesktop.Sdk/x86_64/19.08 org.electronjs.Electron2.BaseApp/x86_64/stable -y

@zigazajc007
Copy link
Author

I got the same issue. I managed to make it work by installing some flatpaks things :

sudo apt install flatpak flatpak-builder elfutils
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak install flathub org.freedesktop.Platform//21.08 org.freedesktop.Sdk//21.08 -y
sudo flatpak install flathub org.freedesktop.Platform/x86_64/19.08 org.freedesktop.Sdk/x86_64/19.08 org.electronjs.Electron2.BaseApp/x86_64/stable -y

I'm now using Fedora as my daily driver and still doesn't work. I have installed those flatpaks and still don't build.

@nkallen
Copy link

nkallen commented Feb 22, 2022

I can't get this to work either...

@alariej
Copy link

alariej commented Mar 16, 2022

Interestingly, I'm trying to build a flatpak using electron-builder --linux flatpak and I get the exact same error. I tried changing node / npm versions: no luck. Also installed the flatpaks suggested by @jochy above: no luck. I'm on Ubuntu 21.10, node 16.11.0, npm 8.1.0. Perhaps @malept has an idea?

  • electron-builder  version=22.14.13 os=5.13.0-35-generic
  • loaded configuration  file=/home/jfa/quadrix/builder-flatpak.json
  • writing effective config  file=dist/builder-effective-config.yaml
  • packaging       platform=linux arch=x64 electron=17.1.2 appOutDir=dist/linux-unpacked
  • building        target=flatpak arch=x64 file=dist/quadrix-0.6.4-x86_64.flatpak
  ⨯ flatpak failed with status code 1  failedTask=build stackTrace=Error: flatpak failed with status code 1
    at ChildProcess.<anonymous> (/home/jfa/quadrix/node_modules/@malept/flatpak-bundler/index.js:71:16)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

@zigazajc007
Copy link
Author

I'm not using electron-builder for flatpaks anymore.

You can create your own .yml file and use flatpak-builder build file.yml --install --force-clean --user command.

Here is the example that I made: https:/flathub/com.rabbit_company.passky

If you make it like that, you can also publish your flatpak to their official repository.

@nkallen
Copy link

nkallen commented Mar 17, 2022

Thanks for the tip! But are you sure we should close the ticket? It seems like this is still a bug in electron-forge

@zigazajc007
Copy link
Author

zigazajc007 commented Mar 17, 2022

Thanks for the tip! But are you sure we should close the ticket? It seems like this is still a bug in electron-forge

I will open it, but to be honest you will never see flatpaks distributed as files. There will always be downloaded from the repository. So the way I have suggested it the only "correct" way of making and distributing flatpaks.

On websites for projects that support Linux, they usually provide .deb, .rpm, .appImage, but never .flatpak. They will always link you to the flatpak repository.

@AlexShemeshWix
Copy link

Whats the satus on this one?

@Xananax
Copy link

Xananax commented Jan 13, 2023

There are good reasons to want to build a flatpak as part of the regular CI, some of which are: being part of the same CI pipeline, using the same options, tooling, pre-processing, and so on (I don't think explaining the benefits of a consistent build pipeline is necessary).

There are also good reasons why a flatpak wouldn't be distributed on Flathub, some of which are: internal tooling, or app in beta trial, or simply not wanting to.

A lot of (betas, alphas) flatpaks are distributed outside of Flathub.

Treating the bug like that is not the right course of action, but if there's no interest in fixing it, claiming Flatpak support is misleading, and it must be removed from the doc.

@goknsh
Copy link

goknsh commented Feb 10, 2023

The following works for me:

sudo apt-get install -y flatpak flatpak-builder elfutils
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
git config --global --add protocol.file.allow always

@OpenSauce04
Copy link

OpenSauce04 commented Mar 6, 2023

Replicated on fresh Manjaro KDE install, simply running this command fixed it for me:
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo

@erickzhao erickzhao changed the title Error when creating flatpak An error occured while making for target: flatpak Mar 8, 2023
@erickzhao erickzhao changed the title An error occured while making for target: flatpak An error occurred while making for target: flatpak Mar 8, 2023
@Fran89
Copy link

Fran89 commented Mar 31, 2024

Replicated on fresh Manjaro KDE install, simply running this command fixed it for me: flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo

This did it, feel free to close it unless it doesn't work for someone else.

@kaubu
Copy link

kaubu commented Jul 26, 2024

Replicated on fresh Manjaro KDE install, simply running this command fixed it for me: flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo

Worked for me, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests