electron: Electron 36 fails to launch because "Using GTK 2/3 and GTK 4 in the same process is not supported"

Preflight Checklist

Electron Version

36.0.0-alpha.1 through 36.0.0-beta.2

What operating system(s) are you using?

Ubuntu

Operating System Version

23.10

What arch are you using?

x64

Last Known Working Electron version

35.*

Expected Behavior

When running Fiddle on Ubuntu with X11, launching the default template works

Actual Behavior

Launching the default template using any of the current 36.X beta and alpha releases fails with the following error:

Electron v36.0.0-alpha.1 started.
(process:12023): Gtk-ERROR **: 11:30:38.382: GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported

Electron exited with signal SIGTRAP.

Testcase Gist URL

Default fiddle template shows this

Additional Information

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 33
  • Comments: 32 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Happens in latest Manjaro, too. I ran into it on Slack. The --gtk-version flag is [obviously] undocumented but works fine.

setting gtk-version=3 works for me. For other people encountering this thread, you can pass it at a command line argument, and you can also set that in your main init script:

app.commandLine.appendSwitch('gtk-version', '3');

the working solution is to add a gtk-version flag to your start command example: electron . --gtk-version=3

Tracked back to https://chromium-review.googlesource.com/c/chromium/src/+/6310469 and seems specific to Mate per conversation with @Kilian - this can be worked around by passing --gtk-version=3 on startup as well.

The doc says “In rare cases, this may cause some applications or configurations to error” It fails on Fedora 42. 😦 Not rare at all.

EDIT: workaround works

… and here on Debian 12.

Issue is fixed as of Electron 37.0.0. Verified on both Fedora 42 and latest Arch Linux (both fully updated).

The issue is also found in Fedora Linux 42. Using --gtk-version=3 in the start command works as mentions by others.

workaround on linux: use flag --gtk-version=3. and run from command line, or change your desktop entry to include it. it works. tested on Arch Linux x86_64

Has this issue been resolved? it’s quite annoying that you need to add the launch argument to the binary just to make it run.

Was this resolved with Electron 37? if so do I need to wait for Electron 37.x.x to be released?

This might be a little off-topic but while --gtk-version=3 (not 4) let me launch the process - it doesn’t seem to properly extend to subprocesses that electron creates; Calling webContents.print() produces a GTK warning for me and prevents the print dialog from opening…

My similar issue also seems be resolved in 37.0.0 at first glance, no GTK warnings and the dialog opens without crashing.

This might be a little off-topic but while --gtk-version=3 (not 4) let me launch the process - it doesn’t seem to properly extend to subprocesses that electron creates; Calling webContents.print() produces a GTK warning for me and prevents the print dialog from opening. (I will note that executing “window.print()” in the view works fine without warnings; but this is not ideal in our case.)

(process:2645): Gtk-ERROR **: 11:43:34.441: GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported.

Last week this also came with a message of a subprocess crashing with child-process-gone, but this week I can’t reproduce the crash message on the same versions and hardware. Because of the inability to reliably call webContents.print in v36, we are downgrading to 35 though.

Some system information: Oracle Linux 9.6 (redhat/fedora-based) Running under mutter/wayland with gnome-kiosk-script-session Seems to have GTK4 and GTK3 installed as dependencies of gdm and gnome-kiosk respectively. When I test installing gnome-kiosk, both 3 and 4 get installed. Removing either will remove gdm and/or gnome-kiosk.

gdm.x86_64 1:40.1-28.0.1.el9_6 ol9_appstream gnome-kiosk 40.0-7 mutter 40.9-24 libwayland-* 1.21.0 gtk3 3.24.31-5 gtk4 4.12.3-2

My system uses gtk4 by default (GNOME 48 on Wayland), but has gtk3 installed for certain apps that did not migrate (yet), and I have the same error message. So this does not only impact the old distros. This might be because of libraries installed for “backwards compatibility” or something. The_ command line switch --gtk-version=3 works just fine. Can someone explain what component/lib triggers this error in which situation? I’d like to help pinpoint the cause so people might be able to fix this on their systems.

In rare cases

Yeah, we (https://podman-desktop.io/) are also facing it on fedora 42

Blocking this until we add a callout to breaking changes doc, but I don’t think fixing the issue itself should block stable

23.04 is kinda old indeed, but I still would expect it to keep working.

The last working electron version is 36.0.0-nightly.20250303. The error first appears in 36.0.0-nightly.20250304.

I’ve tested Electron 36.0.0-beta.4 on my very old Ubuntu 20.04.4 LTS, and the app can run normally, both in development mode and when packaged as AppImage.