{"record":{"id":"26a74149fca4d51f","repo":"tauri-apps/tauri","slug":"can-t-detect-any-appindicator-library","errorCode":null,"errorMessage":"Can't detect any appindicator library","messagePattern":"Can't detect any appindicator library","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-cli/src/interface/rust.rs","lineNumber":1703,"sourceCode":"  use std::process::Command;\n\n  pub enum TrayKind {\n    Ayatana,\n    Libappindicator,\n  }\n\n  pub fn get_appindicator_library_path() -> (TrayKind, String) {\n    match get_library_path(\"ayatana-appindicator3-0.1\") {\n      Some(p) => (\n        TrayKind::Ayatana,\n        format!(\"{p}/libayatana-appindicator3.so.1\"),\n      ),\n      None => match get_library_path(\"appindicator3-0.1\") {\n        Some(p) => (\n          TrayKind::Libappindicator,\n          format!(\"{p}/libappindicator3.so.1\"),\n        ),\n        None => panic!(\"Can't detect any appindicator library\"),\n      },\n    }\n  }\n\n  /// Gets the folder in which a library is located using `pkg-config`.\n  pub fn get_library_path(name: &str) -> Option<String> {\n    let mut cmd = Command::new(\"pkg-config\");\n    cmd.env(\"PKG_CONFIG_ALLOW_SYSTEM_LIBS\", \"1\");\n    cmd.arg(\"--libs-only-L\");\n    cmd.arg(name);\n    if let Ok(output) = cmd.output() {\n      if !output.stdout.is_empty() {\n        // output would be \"-L/path/to/library\\n\"\n        let word = output.stdout[2..].to_vec();\n        Some(String::from_utf8_lossy(&word).trim().to_string())\n      } else {\n        None\n      }","sourceCodeStart":1685,"sourceCodeEnd":1721,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-cli/src/interface/rust.rs#L1685-L1721","documentation":"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.","triggerScenarios":"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).","commonSituations":"Fresh CI containers (ubuntu-latest without libayatana-appindicator3-dev); minimal distributions; headless build servers where only runtime libs, not -dev packages, were installed.","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"],"exampleFix":"# before\nnpm run tauri build  # panic: Can't detect any appindicator library\n\n# after (Ubuntu/Debian)\nsudo apt install -y libayatana-appindicator3-dev\nnpm run tauri build","handlingStrategy":"validation","validationCode":"# fail fast before building a tray-enabled Linux bundle\npkg-config --exists ayatana-appindicator3-0.1 \\\n  || pkg-config --exists appindicator3-0.1 \\\n  || { echo 'missing appindicator dev package; run: sudo apt install libayatana-appindicator3-dev'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["linux","tray","appindicator","pkg-config","tauri-bundler","system-dependency"],"backgroundTag":"missing-system-library","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}