ubuntutauriubuntu-24.04

Tauri App Build Fails on Ubuntu 24: javascriptcoregtk-4.0 >= 2.24 and webkit2gtk-4.0 >= 2.22 Requirement can't be satisfied


I'm trying to run a Tauri app (awesome-app) on Ubuntu 24 (awesome-app dev)

I followed the prerequisites outlined in the official tutorial. For Ubuntu 20, the tutorial suggests installing the following dependencies:

npm i
npm i -g tauri
sudo aptitude install -y \
  build-essential \
  libpango1.0-dev \
  libsoup2.4-dev \
  libjavascriptcoregtk-4.0-dev \
  libgdk-pixbuf2.0-dev \
  libgtk-3-dev \
  libwebkit2gtk-4.0-dev 

Since there’s no specific guide for Ubuntu 24, I applied the same instructions, but I encountered the following error during the build process: (presented chosen parts of log)

warning: javascriptcore-rs-sys@0.4.0: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "javascriptcoregtk-4.0" "javascriptcoregtk-4.0 >= 2.24"` did not exit successfully: exit status: 1

error: failed to run custom build command for `javascriptcore-rs-sys v0.4.0`

  --- stderr
  Package dependency requirement 'javascriptcoregtk-4.0 >= 2.24' could not be satisfied.
  Package 'javascriptcoregtk-4.0' has version '2.20.1', required version is '>= 2.24'

warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: webkit2gtk-sys@0.18.0: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "webkit2gtk-4.0" "webkit2gtk-4.0 >= 2.22"` did not exit successfully: exit status: 1

error: failed to run custom build command for `webkit2gtk-sys v0.18.0`

  --- stderr
  Package dependency requirement 'webkit2gtk-4.0 >= 2.22' could not be satisfied.
  Package 'webkit2gtk-4.0' has version '2.20.1', required version is '>= 2.22'

It seems my system is missing the required versions of javascriptcoregtk-4.0 (>= 2.24) and webkit2gtk-4.0 (>= 2.22). The versions currently available on my system are:


Solution

  • This is a known issue running tauri v1 on Ubuntu 24. See issue here.

    I believe the only official solution is to use tauri v2. The issue describes some workarounds.

    Based on this issue comment I "solved" it doing

    echo "deb http://archive.ubuntu.com/ubuntu jammy main universe" > /etc/apt/sources.list.d/ubuntu22.list
    apt update
    apt install libwebkit2gtk-4.0-dev
    rm /etc/apt/sources.list.d/ubuntu22.list