tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
84.06k stars 2.53k forks source link

[bug] Gstreamer issues under Arch Linux when using AppImage #4642

Open RubenKelevra opened 2 years ago

RubenKelevra commented 2 years ago

Describe the bug

I try to create a simple App which shows a single website. The idea is to replicate the functionality of electron-nativefier. I thought I start with WhatsApp:

https://github.com/RubenKelevra/whatsapp-tauri

When I set tauri.bundle.appimage.bundleMediaFramework to true, the compilation will fail with this error:

$ cargo tauri build -b appimage
   Compiling app v0.1.0 (/home/rubenk/dev/tauri-whatsapp/src-tauri)
^X@sk    Finished release [optimized] target(s) in 24.94s
    Bundling whats-app_0.1.1_amd64.AppImage (/home/rubenk/dev/tauri-whatsapp/src-tauri/target/release/bundle/appimage/whats-app_0.1.1_amd64.AppImage)
       Error failed to bundle project: error running appimage.sh: error running appimage.sh: `failed to run /home/rubenk/dev/tauri-whatsapp/src-tauri/target/release/bundle/appimage/build_appimage.sh`

When I set it to false the build process works fine, but I won't be able to use it: The main window launches but the window-content remains white blank and that's it.

On the console the appimage will print the following:

$ /home/rubenk/dev/tauri-whatsapp/src-tauri/target/release/bundle/appimage/whats-app_0.1.1_amd64.AppImage
GStreamer element autoaudiosink not found. Please install it

(WebKitWebProcess:440827): GLib-GObject-WARNING **: 14:51:10.999: invalid (NULL) pointer instance

(WebKitWebProcess:440827): GLib-GObject-CRITICAL **: 14:51:10.999: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

The deb builds fine and does start and render the website. There's also audio playback possible.

The system is ArchLinux with Linux 5.18.8-xanmod1, I use KDE 5.25.2 and the user session runs on Wayland 1.21.0. Arch Linux already uses pipewire - so maybe there are some incompatibilities? Tauri gets compiled with Rust 1.62.0, and I've just set up the development environment yesterday by running:

$ cargo install tauri-cli --version "^1.0.0"
$ cargo tauri init

The release binaries are build with the standard cargo tauri build.

I've installed the necessary packages from the Readme for Arch Linux:

webkit2gtk, gtk3, libayatana-appindicator

Reproduction

  1. try to start AppImages bundles

OR

  1. start building a bundle with AppImage as target and tauri.bundle.appimage.bundleMediaFramework set to true

Expected behavior

Build and runs fine, regardless of the flag.

Platform and versions

$ cargo tauri info

Environment
  › OS: EndeavourOS Rolling Release X64
  › Node.js: 16.16.0
  › npm: 8.13.1
  › pnpm: Not installed!
  › yarn: 1.22.19
  › rustup: Not installed!
  › rustc: 1.62.0
  › cargo: 1.62.0
  › Rust toolchain: 

Packages
WARNING: no lock files found, defaulting to npm
  › @tauri-apps/cli [NPM]: 1.0.3
  › @tauri-apps/api [NPM]: Not installed!
  › tauri [RUST]: 1.0.3,
  › tauri-build [RUST]: 1.0.3,
  › tao [RUST]: 0.12.1,
  › wry [RUST]: 0.19.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: https://web.whatsapp.com/
  › devPath: https://web.whatsapp.com/
package.json not found

App directory structure
  ├─ .github
  ├─ src-tauri
  └─ .git

Stack trace

No response

Additional context

No response

FabianLars commented 2 years ago

tauri.bundle.appimage.bundleMediaFramework works only when building on ubuntu for now. I wanted to "fix" this for weeks now, but couldn't find the time to do it yet...

That said, you don't want to build distributable apps on arch anyway, because these apps can only work on rolling release distros then. "Build your app on the oldest system you want to support", see https://tauri.app/v1/guides/distribution/linux#limitations If they are meant for local usages only, i don't reallyyy see why you'd want to use appimages anyway (file size)

RubenKelevra commented 2 years ago

I'm fine with not supporting older versions of operating systems. 🤷🏼

I would have not looked into app images if this wouldn't be a default bundle, and thus I checked both. AppImage wasn't working so I was curious what I did wrong.

Maybe the solution would be to remove AppImages altogether as standard bundle?

Would be kinda neat if tauri could output PKGBUILD files, so not "arch packages" (which cannot be distributed that easily) but just the build instructions to create tauri apps locally.

So kinda like https://github.com/tauri-apps/tauri/issues/3728, but just creating the main file from the config file and place everything else necessary as dependency or as files next to it.

This way tauri packages can be easily shared on the AUR, with only the need to place binary files, like sidecars (if not possible to put them in a dedicated package) on a server.

erayerdin commented 2 years ago

Same issue:

GStreamer element autoaudiosink not found. Please install it

(WebKitWebProcess:141658): GLib-GObject-WARNING **: 01:59:06.463: invalid (NULL) pointer instance

(WebKitWebProcess:141658): GLib-GObject-CRITICAL **: 01:59:06.463: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

on KDE Neon with Ubuntu 20.04 base.

FabianLars commented 2 years ago

@erayerdin it's not the same issue, you just didn't build your app with the mentioned tauri.bundle.appimage.bundleMediaFramework config enabled. Doing so should make it work.

erayerdin commented 2 years ago

it does not work, here is the environment:

tauri.conf.json is as below:

{
  "$schema": "../node_modules/@tauri-apps/cli/schema.json",
  "build": {
    "beforeBuildCommand": "",
    "beforeDevCommand": "",
    "devPath": "../dist",
    "distDir": "../dist"
  },
  "package": {
    "productName": "taurapp",
    "version": "0.1.2-alpha"
  },
  "tauri": {
    "allowlist": {
      "all": true
    },
    "bundle": {
      "appimage": {
        "bundleMediaFramework": true
      },
      "active": true,
      "category": "DeveloperTool",
      "copyright": "",
      "deb": {
        "depends": []
      },
      "externalBin": [],
      "icon": [
        "icons/32x32.png",
        "icons/128x128.png",
        "icons/128x128@2x.png",
        "icons/icon.icns",
        "icons/icon.ico"
      ],
      "identifier": "com.erayerdin.taurapp",
      "longDescription": "",
      "macOS": {
        "entitlements": null,
        "exceptionDomain": "",
        "frameworks": [],
        "providerShortName": null,
        "signingIdentity": null
      },
      "resources": [],
      "shortDescription": "",
      "targets": "all",
      "windows": {
        "certificateThumbprint": null,
        "digestAlgorithm": "sha256",
        "timestampUrl": ""
      }
    },
    "security": {
      "csp": null
    },
    "updater": {
      "active": false
    },
    "windows": [
      {
        "fullscreen": false,
        "height": 600,
        "resizable": true,
        "title": "TaurApp",
        "width": 800
      }
    ],
    "systemTray": {
      "iconPath": "icons/128x128.png",
      "iconAsTemplate": true
    }
  }
}

Runtime environment is KDE Neon with Ubuntu 20.04 base.

The project is open source and hosted here.

It logs out these on launch:

GStreamer element autoaudiosink not found. Please install it

(WebKitWebProcess:31764): GLib-GObject-WARNING **: 11:54:31.420: invalid (NULL) pointer instance

(WebKitWebProcess:31764): GLib-GObject-CRITICAL **: 11:54:31.420: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

Whether you set tauri.bundle.appimage.bundleMediaFramework to true or false, the result is the same.

spirityy commented 2 years ago

same situation. image

erayerdin commented 2 years ago

@spirityy Can you do below?

rm src-tauri/target/release/bundle/appimage/*.AppDir/ -rfv

I have just realized that it fails to build similar to your case if <appname>.AppDir directory already exists.

spirityy commented 2 years ago

it works! thx.

perroboc commented 1 year ago

Hi! Just confirming that this is still an issue using Arch and Tauri 1.3

GStreamer element autoaudiosink not found. Please install it

(WebKitWebProcess:82481): GLib-GObject-CRITICAL **: 11:50:26.506: invalid (NULL) pointer instance

(WebKitWebProcess:82481): GLib-GObject-CRITICAL **: 11:50:26.506: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
developomp commented 1 year ago

Issue persists in the latest 2.0.0 alpha releases

cargo tauri info

[✔] Environment
    - OS: Arch Linux Rolling Release X64
    ✔ webkit2gtk-4.1: 2.40.3
    ✔ rsvg2: 2.56.2
    ✔ rustc: 1.71.0 (8ede3aae2 2023-07-12)
    ✔ Cargo: 1.71.0 (cfd3bbd8f 2023-06-08)
    ✔ rustup: 1.26.0 (2023-05-04)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 18.16.0
    - pnpm: 8.6.9
    - yarn: 1.22.19
    - npm: 9.8.0

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.10
    - tauri-build [RUST]: 2.0.0-alpha.6
    - wry [RUST]: 0.28.3
    - tao [RUST]: 0.19.1
    - @tauri-apps/api [NPM]: 2.0.0-alpha.4
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.10

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: SolidJS
    - bundler: Vite
GStreamer element autoaudiosink not found. Please install it

(WebKitWebProcess:91838): GLib-GObject-CRITICAL **: 14:12:54.056: invalid (NULL) pointer instance

(WebKitWebProcess:91838): GLib-GObject-CRITICAL **: 14:12:54.056: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
developomp commented 1 year ago

Installing the gst-plugins-good package seems to fix the issue.

sudo pacman -S gst-plugins-good
a937983423 commented 9 months ago

我也遇到这个问题,也是archlinux

matallui commented 5 months ago

I'm encountering similar issue, but I'm running on Ubuntu-22.04. No idea what the issue is as the logs are not clear.

    Bundling display_0.1.0_aarch64.AppImage (/ws/apps/display-expo/src-tauri/target/release/bundle/appimage/display_0.1.0_aarch64.AppImage)
       Error failed to bundle project: error running appimage.sh
root@08c41fce0881:/ws/apps/display-expo# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
root@08c41fce0881:/ws/apps/display-expo# uname -a
Linux 08c41fce0881 6.6.26-linuxkit #1 SMP Sat Apr 27 04:13:19 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

EDIT: For me it was missing pathelf, so after installing that it all worked fine.