{"record":{"id":"2a290a1fb2d5c352","repo":"tauri-apps/tauri","slug":"failed-to-get-ayatana-appindicator-library-path-us","errorCode":null,"errorMessage":"failed to get ayatana-appindicator library path using pkg-config.","messagePattern":"failed to get ayatana-appindicator library path using pkg-config\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-cli/src/interface/rust.rs","lineNumber":1389,"sourceCode":"  let mut appimage_files = config.linux.appimage.files;\n\n  // set env vars used by the bundler and inject dependencies\n  #[cfg(target_os = \"linux\")]\n  {\n    let mut libs: Vec<String> = Vec::new();\n\n    if enabled_features.contains(&\"tray-icon\".into())\n      || enabled_features.contains(&\"tauri/tray-icon\".into())\n    {\n      let (tray_kind, path) = std::env::var_os(\"TAURI_LINUX_AYATANA_APPINDICATOR\")\n        .map(|ayatana| {\n          if ayatana == \"true\" || ayatana == \"1\" {\n            (\n              pkgconfig_utils::TrayKind::Ayatana,\n              format!(\n                \"{}/libayatana-appindicator3.so.1\",\n                pkgconfig_utils::get_library_path(\"ayatana-appindicator3-0.1\")\n                  .expect(\"failed to get ayatana-appindicator library path using pkg-config.\")\n              ),\n            )\n          } else {\n            (\n              pkgconfig_utils::TrayKind::Libappindicator,\n              format!(\n                \"{}/libappindicator3.so.1\",\n                pkgconfig_utils::get_library_path(\"appindicator3-0.1\")\n                  .expect(\"failed to get libappindicator-gtk library path using pkg-config.\")\n              ),\n            )\n          }\n        })\n        .unwrap_or_else(pkgconfig_utils::get_appindicator_library_path);\n      match tray_kind {\n        pkgconfig_utils::TrayKind::Ayatana => {\n          depends_deb.push(\"libayatana-appindicator3-1\".into());\n          libs.push(\"libayatana-appindicator3.so.1\".into());","sourceCodeStart":1371,"sourceCodeEnd":1407,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-cli/src/interface/rust.rs#L1371-L1407","documentation":"When bundling Linux packages with the tray-icon feature enabled and TAURI_LINUX_AYATANA_APPINDICATOR set to true/1, the CLI asks pkg-config for the library directory of ayatana-appindicator3-0.1 to locate libayatana-appindicator3.so.1 for deb/appimage metadata. get_library_path returns None when pkg-config is missing, fails, or the .pc file is not found, and this expect panics.","triggerScenarios":"`tauri build` producing a deb/appimage with tray-icon or tauri/tray-icon enabled, TAURI_LINUX_AYATANA_APPINDICATOR=true (or 1), on a system without libayatana-appindicator3-dev installed, without pkg-config installed, or with a custom prefix missing from PKG_CONFIG_PATH.","commonSituations":"Clean CI containers (ubuntu-debootstrap style minimal images) lacking the -dev packages; build containers pinned to old images that shipped libappindicator instead of ayatana; sysroots where PKG_CONFIG_PATH does not cover /usr/lib/<triplet>/pkgconfig.","solutions":["Install the development package and pkg-config: `sudo apt-get install -y pkg-config libayatana-appindicator3-dev` (Fedora: `sudo dnf install pkgconf-pkg-config libayatana-appindicator-gtk3-devel`).","Verify detection manually: `pkg-config --libs-only-L ayatana-appindicator3-0.1` must print a -L path.","If your system actually provides the older libappindicator, unset TAURI_LINUX_AYATANA_APPINDICATOR (or set it to a value other than true/1) so the CLI takes the auto-detect/libappindicator path.","For custom prefixes, export PKG_CONFIG_PATH=/your/prefix/lib/pkgconfig before building."],"exampleFix":"# before: panic 'failed to get ayatana-appindicator library path'\n$ tauri build\n\n# after: install deps in the build image\n$ sudo apt-get install -y pkg-config libayatana-appindicator3-dev\n$ tauri build","handlingStrategy":"validation","validationCode":"# Precheck the exact probe tauri performs\npkg-config --libs-only-L ayatana-appindicator3-0.1 | grep -q -- '-L' || {\n  echo 'install: sudo apt-get install -y pkg-config libayatana-appindicator3-dev'; exit 1;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bake pkg-config and libayatana-appindicator3-dev into Linux build images when the tray feature is enabled.","Add the pkg-config probe above as a CI preflight step.","Document required Linux system deps per distro in the project README."],"tags":["linux","pkg-config","ayatana","appindicator","tray-icon","tauri-bundler"],"backgroundTag":"pkg-config-library-not-found","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}