tauri-apps/tauri · error
Can't detect any appindicator library
Error message
Can't detect any appindicator library
What it means
Panic in the Linux bundling path of the Tauri CLI. To package apps with a tray icon it probes `pkg-config --libs-only-L` first for ayatana-appindicator3-0.1, then appindicator3-0.1; when both come back empty it panics because it cannot determine which libappindicator variant to bundle against.
Source
Thrown at crates/tauri-cli/src/interface/rust.rs:1703
use std::process::Command;
pub enum TrayKind {
Ayatana,
Libappindicator,
}
pub fn get_appindicator_library_path() -> (TrayKind, String) {
match get_library_path("ayatana-appindicator3-0.1") {
Some(p) => (
TrayKind::Ayatana,
format!("{p}/libayatana-appindicator3.so.1"),
),
None => match get_library_path("appindicator3-0.1") {
Some(p) => (
TrayKind::Libappindicator,
format!("{p}/libappindicator3.so.1"),
),
None => panic!("Can't detect any appindicator library"),
},
}
}
/// Gets the folder in which a library is located using `pkg-config`.
pub fn get_library_path(name: &str) -> Option<String> {
let mut cmd = Command::new("pkg-config");
cmd.env("PKG_CONFIG_ALLOW_SYSTEM_LIBS", "1");
cmd.arg("--libs-only-L");
cmd.arg(name);
if let Ok(output) = cmd.output() {
if !output.stdout.is_empty() {
// output would be "-L/path/to/library\n"
let word = output.stdout[2..].to_vec();
Some(String::from_utf8_lossy(&word).trim().to_string())
} else {
None
}View on GitHub (pinned to 52e4b6e71d)
Solutions
- Install the dev package: `sudo apt install libayatana-appindicator3-dev` (Debian/Ubuntu) or `sudo dnf install libayatana-appindicator3-devel` (Fedora)
- Verify detection: `pkg-config --libs-only-L ayatana-appindicator3-0.1` must print a -L path
- If you do not need a tray icon, remove the tray icon configuration so the bundler skips the appindicator requirement
Example fix
# before npm run tauri build # panic: Can't detect any appindicator library # after (Ubuntu/Debian) sudo apt install -y libayatana-appindicator3-dev npm run tauri build
Defensive patterns
Strategy: validation
Validate before calling
# fail fast before building a tray-enabled Linux bundle
pkg-config --exists ayatana-appindicator3-0.1 \
|| pkg-config --exists appindicator3-0.1 \
|| { echo 'missing appindicator dev package; run: sudo apt install libayatana-appindicator3-dev'; exit 1; } Prevention
- Add libayatana-appindicator3-dev (or -devel) to the base image / justfile setup step
- Keep a setup script (apt install ...) checked in next to the build script for Linux tray apps
- If tray support is optional, gate the tray config so non-tray builds skip the dependency
When it happens
Trigger: Building a Tauri app that uses a tray icon on a Linux system without the appindicator development packages installed, or where pkg-config cannot see them (wrong PKG_CONFIG_PATH, missing .pc files despite runtime libs present).
Common situations: Fresh CI containers (ubuntu-latest without libayatana-appindicator3-dev); minimal distributions; headless build servers where only runtime libs, not -dev packages, were installed.
Related errors
- failed to get ayatana-appindicator library path using pkg-co
- failed to get libappindicator-gtk library path using pkg-con
- couldn't find a square icon to use as AppImage icon
- Can't read source directory
- Unexpected target triple {}
AI-assisted analysis of tauri-apps/tauri@52e4b6e71d (2026-08-20).
Data as JSON: /api/errors/26a74149fca4d51f.
Report an issue: GitHub.