tauri: [bug] failed to bundle project: error running appimage.sh

Describe the bug

Build a hello word project, run pnpm tauri build, get a error:

   Compiling serialize-to-javascript v0.1.1
   Compiling serde_repr v0.1.9
   Compiling state v0.5.3
   Compiling webkit2gtk v0.18.2
    Finished release [optimized] target(s) in 2m 14s
    Bundling tauri-app-js_0.0.0_amd64.deb (/home/xujin/My_Projects/learning/learning-tauri/tauri-app-js/src-tauri/target/release/bundle/deb/tauri-app-js_0.0.0_amd64.deb)
    Bundling tauri-app-js_0.0.0_amd64.AppImage (/home/xujin/My_Projects/learning/learning-tauri/tauri-app-js/src-tauri/target/release/bundle/appimage/tauri-app-js_0.0.0_amd64.AppImage)
       Error failed to bundle project: error running appimage.sh: error running appimage.sh: `failed to run /home/xujin/My_Projects/learning/learning-tauri/tauri-app-js/src-tauri/target/release/bundle/appimage/build_appimage.sh`
 ELIFECYCLE  Command failed with exit code 1.

Reproduction

run pnpm tauri build

Expected behavior

Build success.

Platform and versions

Environment
  › OS: Manjaro 22.0.0 X64
  › Node.js: 16.18.1
  › npm: 8.19.2
  › pnpm: 7.18.1
  › yarn: Not installed!
  › rustup: 1.25.1
  › rustc: 1.65.0
  › cargo: 1.65.0
  › Rust toolchain: stable-x86_64-unknown-linux-gnu 

Packages
  › @tauri-apps/cli [NPM]: 1.2.1
  › @tauri-apps/api [NPM]: 1.2.0
  › tauri [RUST]: 1.2.1,
  › tauri-build [RUST]: 1.2.1,
  › tao [RUST]: 0.15.6,
  › wry [RUST]: 0.22.6,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:1420/

App directory structure
  ├─ src
  ├─ .vscode
  ├─ src-tauri
  ├─ node_modules
  └─ dist

Stack trace

No response

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 23 (4 by maintainers)

Commits related to this issue

Most upvoted comments

In my case librsvg library was missing:

-- Running input plugin: gtk -- 
[gtk/stdout] Installing AppRun hook
[gtk/stderr] chmod: cannot access 'viewer.AppDir/usr/lib64': No such file or directory
[gtk/stdout] Installing GLib schemas
[gtk/stderr] Package librsvg-2.0 was not found in the pkg-config search path.
[gtk/stderr] Perhaps you should add the directory containing `librsvg-2.0.pc'
[gtk/stderr] to the PKG_CONFIG_PATH environment variable
[gtk/stderr] No package 'librsvg-2.0' found
[gtk/stdout] Installing GTK 3.0 modules
[gtk/stdout] Updating immodules cache in viewer.AppDir//usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache
[gtk/stdout] Installing GDK PixBufs
[gtk/stdout] Updating pixbuf cache in viewer.AppDir//usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
[gtk/stdout] Copying more libraries
[gtk/stderr] /home/****/.cache/tauri/linuxdeploy-plugin-gtk.sh: there is no 'libdir' variable for 'librsvg-2.0' library.
[gtk/stderr] Please check the 'librsvg-2.0.pc' file is present in $PKG_CONFIG_PATH (you may need to install the appropriate -dev/-devel package).
ERROR: Failed to run plugin: gtk (exit code: 1) 
       Error [tauri_cli_node] failed to bundle project: error running appimage.sh: error running appimage.sh: `failed to run /home/dostolski/projects/viewer/src-tauri/target/release/bundle/appimage/build_appimage.sh`

I had to install it using Ubuntu package manager:

 sudo apt-get install librsvg2-dev

BR, Darek

Closing this as OP’s (and hopefully all the others’) issues are resolved and a catch all issue is not really helpful considering that this error message can be caused by many different root causes.

In general in case anyone sees this error message and none of the messages here help them. Please re-run it with the --verbose flag and open a new issue with the logs. Thank you.

$ sudo ln -s /usr/lib/libavif.so.16 /usr/lib/libavif.so.15

@yozachar You have installed the latest version, which only contains .so.16. See package content here. I found that symlinking both old libraries to their respective newer versions works, but it’s probably not and ideal solution.

Symlinking works, thanks! Yeah that’s true.

For those looking to temporally disable AppImage build you can change "targets": "all" in src-tauri/tauri.conf.json file to:

"targets": ["deb", "nsis", "msi", "app", "dmg", "updater"],

Ref: https://tauri.app/v1/guides/building/linux#prerequisites

I also got the same error message “Error failed to bundle project: error running appimage.sh”. but the reason might be different. the content https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh is blocked by the GWT and failed to build the appImage. below is the log and testing I did.

✔ Browser application bundle generation complete.
+ TRAY_LIBRARY_PATH=0
+ '[' x86_64 == i686 ']'
+ linuxdeploy_arch=x86_64
+ wget -q -4 -N https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
       Error [tauri_cli_node] failed to bundle project: error running appimage.sh
$ wget -v -4 -N https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
--2023-08-22 14:23:35--  https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 0.0.0.0
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443... failed: Connection refused.

Is it possible to move the dependant scripts be moved into a Rust crate instead of getting them from internet runtime and show explicit error message instead of a general error message?

@larryteal if you use npm there needs to be an extra -- like this npm run tauri build -- --verbose

Thank You @FabianLars . npm run tauri build -- --verbose working.

I build my APP on jetson nano, is ARMv8 system. There are two problems.

1, find: ‘/usr/lib/ssl/private’: Permission denied

2, This link is 404, https://github.com/tauri-apps/binary-releases/releases/download/linuxdeploy/linuxdeploy-aarch64.AppImage

I have add my user to ssl-cert group and root group, but still find: ‘/usr/lib/ssl/private’: Permission denied

+ export ARCH=aarch64
+ ARCH=aarch64
+ APPIMAGE_BUNDLE_XDG_OPEN=1
+ APPIMAGE_BUNDLE_GSTREAMER=0
+ TRAY_LIBRARY_PATH=0
+ '[' aarch64 == i686 ']'
+ linuxdeploy_arch=aarch64
+ mkdir -p tauri-a1.AppDir
+ cp -r ../appimage_deb/data/usr tauri-a1.AppDir
+ cd tauri-a1.AppDir
+ mkdir -p usr/bin
+ mkdir -p usr/lib
+ [[ 1 != \0 ]]
+ [[ -f /usr/bin/xdg-open ]]
+ echo 'Copying /usr/bin/xdg-open'
+ cp /usr/bin/xdg-open usr/bin
Copying /usr/bin/xdg-open
+ [[ 0 != \0 ]]
++ dirname '{}'
+ find -L /usr/lib -name WebKitNetworkProcess -exec mkdir -p . ';' -exec cp --parents '{}' . ';'
find: File system loop detected; ‘/usr/lib/chromium-browser/libs’ is part of the same file system loop as ‘/usr/lib/chromium-browser’.
find: ‘/usr/lib/ssl/private’: Permission denied
+ true
++ dirname '{}'
+ find -L /usr/lib -name WebKitWebProcess -exec mkdir -p . ';' -exec cp --parents '{}' . ';'
find: File system loop detected; ‘/usr/lib/chromium-browser/libs’ is part of the same file system loop as ‘/usr/lib/chromium-browser’.
find: ‘/usr/lib/ssl/private’: Permission denied
+ true
++ dirname '{}'
+ find -L /usr/lib -name libwebkit2gtkinjectedbundle.so -exec mkdir -p . ';' -exec cp --parents '{}' . ';'
find: File system loop detected; ‘/usr/lib/chromium-browser/libs’ is part of the same file system loop as ‘/usr/lib/chromium-browser’.
find: ‘/usr/lib/ssl/private’: Permission denied
+ true
+ cd /home/user/.cache/tauri
+ wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-aarch64
+ chmod +x /home/user/.cache/tauri/AppRun-aarch64
+ cp /home/user/.cache/tauri/AppRun-aarch64 AppRun
+ cp usr/share/icons/hicolor/256x256@2/apps/tauri-a1.png .DirIcon
+ ln -sf usr/share/icons/hicolor/256x256@2/apps/tauri-a1.png tauri-a1.png
+ ln -sf usr/share/applications/tauri-a1.desktop tauri-a1.desktop
+ cd ..
+ [[ 0 != \0 ]]
+ gst_plugin=
+ cd /home/user/.cache/tauri
+ wget -q -4 -N https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
+ cd /home/user/.cache/tauri
+ wget -q -4 -N https://github.com/tauri-apps/binary-releases/releases/download/linuxdeploy/linuxdeploy-aarch64.AppImage
       Error [tauri_cli_node] failed to bundle project: error running appimage.sh

Same error, may related to this: failed to create symbolic link ‘tauri-app.png’: File exists

When I commented out the ln commands in target/release/bundle/appimage/build_appimage.sh, it succeeded, but fails the next time I run the build.

The -f might help?

ln -s -f “usr/share/icons/hicolor/256x256@2/apps/tauri-app.png” “tauri-app.png” ln -s -f “usr/share/applications/tauri-app.desktop” “tauri-app.desktop”

Please re-run it with the verbose flag; pnpm tauri build --verbose Hopefully we get more helpful output then.

Hello, thanks for your help, i might know what’s causing the problem: Incomplete file download for linuxdeploy-x86_64.AppImage .

       Debug [handlebars::render] Rendering value: Path(Relative(([Named("appimage_filename")], "appimage_filename")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("tauri_tools_path")], "tauri_tools_path")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("app_name")], "app_name")))
    Bundling [tauri_bundler::bundle::linux::appimage] tauri-app-js_0.0.0_amd64.AppImage (/home/xujin/My_Projects/learning/learning-tauri/tauri-app-js/src-tauri/target/release/bundle/appimage/tauri-app-js_0.0.0_amd64.AppImage)
     Running [tauri_bundler::bundle::common] Command `/home/xujin/My_Projects/learning/learning-tauri/tauri-app-js/src-tauri/target/release/bundle/appimage/build_appimage.sh `
+ export ARCH=x86_64
+ ARCH=x86_64
+ APPIMAGE_BUNDLE_XDG_OPEN=0
+ APPIMAGE_BUNDLE_GSTREAMER=0
+ TRAY_LIBRARY_PATH=0
+ '[' x86_64 == i686 ']'
+ linuxdeploy_arch=x86_64
+ mkdir -p tauri-app-js.AppDir
+ cp -r ../appimage_deb/data/usr tauri-app-js.AppDir
+ cd tauri-app-js.AppDir
+ mkdir -p usr/bin
+ mkdir -p usr/lib
+ [[ 0 != \0 ]]
+ [[ 0 != \0 ]]
++ dirname '{}'
+ find /usr/lib /usr/lib32 /usr/lib64 -name WebKitNetworkProcess -exec mkdir -p . ';' -exec cp --parents '{}' . ';'
find: ‘/usr/lib/firmware/b43’: 权限不够find: ‘/usr/lib/firmware/b43legacy’: 权限不够+ true
++ dirname '{}'
+ find /usr/lib /usr/lib32 /usr/lib64 -name WebKitWebProcess -exec mkdir -p . ';' -exec cp --parents '{}' . ';'
find: ‘/usr/lib/firmware/b43’: 权限不够find: ‘/usr/lib/firmware/b43legacy’: 权限不够+ true
++ dirname '{}'
+ find /usr/lib /usr/lib32 /usr/lib64 -name libwebkit2gtkinjectedbundle.so -exec mkdir -p . ';' -exec cp --parents '{}' . ';'
find: ‘/usr/lib/firmware/b43’: 权限不够find: ‘/usr/lib/firmware/b43legacy’: 权限不够+ true
+ cd /home/xujin/.cache/tauri
+ wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-x86_64
        + chmod +x /home/xujin/.cache/tauri/AppRun-x86_64
+ cp /home/xujin/.cache/tauri/AppRun-x86_64 AppRun
+ cp usr/share/icons/hicolor/256x256@2/apps/tauri-app-js.png .DirIcon
+ ln -s usr/share/icons/hicolor/256x256@2/apps/tauri-app-js.png tauri-app-js.png
+ ln -s usr/share/applications/tauri-app-js.desktop tauri-app-js.desktop
+ cd ..
+ [[ 0 != \0 ]]
+ gst_plugin=
+ cd /home/xujin/.cache/tauri
+ wget -q -4 -N https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
+ cd /home/xujin/.cache/tauri
+ wget -q -4 -N https://github.com/tauri-apps/binary-releases/releases/download/linuxdeploy/linuxdeploy-x86_64.AppImage
+ chmod +x /home/xujin/.cache/tauri/linuxdeploy-plugin-gtk.sh
+ chmod +x /home/xujin/.cache/tauri/linuxdeploy-x86_64.AppImage
+ dd if=/dev/zero bs=1 count=3 seek=8 conv=notrunc of=/home/xujin/.cache/tauri/linuxdeploy-x86_64.AppImage
输入了 3+0 块记录输出了 3+0 块记录3 字节已复制,0.00151879 s,2.0 kB/s
+ OUTPUT=tauri-app-js_0.0.0_amd64.AppImage
+ /home/xujin/.cache/tauri/linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir tauri-app-js.AppDir --plugin gtk --output appimage
Something went wrong trying to read the squashfs image.
Failed to open squashfs image
Failed to extract AppImage
       Error [tauri_cli_node] failed to bundle project: error running appimage.sh: error running appimage.sh: `failed to run /home/xujin/My_Projects/learning/learning-tauri/tauri-app-js/src-tauri/target/release/bundle/appimage/build_appimage.sh`
 ELIFECYCLE  Command failed with exit code 1.

In my case librsvg library was missing:

-- Running input plugin: gtk -- 
[gtk/stdout] Installing AppRun hook
[gtk/stderr] chmod: cannot access 'viewer.AppDir/usr/lib64': No such file or directory
[gtk/stdout] Installing GLib schemas
[gtk/stderr] Package librsvg-2.0 was not found in the pkg-config search path.
[gtk/stderr] Perhaps you should add the directory containing `librsvg-2.0.pc'
[gtk/stderr] to the PKG_CONFIG_PATH environment variable
[gtk/stderr] No package 'librsvg-2.0' found
[gtk/stdout] Installing GTK 3.0 modules
[gtk/stdout] Updating immodules cache in viewer.AppDir//usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache
[gtk/stdout] Installing GDK PixBufs
[gtk/stdout] Updating pixbuf cache in viewer.AppDir//usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
[gtk/stdout] Copying more libraries
[gtk/stderr] /home/****/.cache/tauri/linuxdeploy-plugin-gtk.sh: there is no 'libdir' variable for 'librsvg-2.0' library.
[gtk/stderr] Please check the 'librsvg-2.0.pc' file is present in $PKG_CONFIG_PATH (you may need to install the appropriate -dev/-devel package).
ERROR: Failed to run plugin: gtk (exit code: 1) 
       Error [tauri_cli_node] failed to bundle project: error running appimage.sh: error running appimage.sh: `failed to run /home/dostolski/projects/viewer/src-tauri/target/release/bundle/appimage/build_appimage.sh`

I had to install it using Ubuntu package manager:

 sudo apt-get install librsvg2-dev

BR, Darek

This seems to have fixed it for me, thank you.

This one is weird, as I already have the library

@yozachar You have installed the latest version, which only contains .so.16. See package content here. I found that symlinking both old libraries to their respective newer versions works, but it’s probably not and ideal solution.

Please re-run it with the verbose flag; pnpm tauri build --verbose Hopefully we get more helpful output then.