{"record":{"id":"4678293957efb345","repo":"tauri-apps/tauri","slug":"failed-to-get-libappindicator-gtk-library-path-usi","errorCode":null,"errorMessage":"failed to get libappindicator-gtk library path using pkg-config.","messagePattern":"failed to get libappindicator-gtk library path using pkg-config\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-cli/src/interface/rust.rs","lineNumber":1398,"sourceCode":"    {\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());\n        }\n        pkgconfig_utils::TrayKind::Libappindicator => {\n          depends_deb.push(\"libappindicator3-1\".into());\n          libs.push(\"libappindicator3.so.1\".into());\n        }\n      }\n\n      // conditionally setting it in case the user provided its own version for some reason\n      let path = PathBuf::from(path);","sourceCodeStart":1380,"sourceCodeEnd":1416,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-cli/src/interface/rust.rs#L1380-L1416","documentation":"With tray-icon enabled and TAURI_LINUX_AYATANA_APPINDICATOR set to any value other than true/1, the CLI is forced onto the libappindicator branch and asks pkg-config for appindicator3-0.1 to locate libappindicator3.so.1. If that .pc file cannot be found (package not installed, no pkg-config), get_library_path returns None and this expect panics. Note the env var is a strict opt-out of ayatana: values like 'false', '0', or typos all select this branch.","triggerScenarios":"`tauri build` for deb/appimage with the tray feature while TAURI_LINUX_AYATANA_APPINDICATOR is exported as e.g. 'false' or '0' on a system without libappindicator-gtk3-dev (most modern distros removed libappindicator in favor of ayatana).","commonSituations":"Copied CI env vars from old projects forcing libappindicator on Ubuntu 22.04+/Debian 12 where appindicator3-0.1 no longer exists; Docker build images upgraded without updating the env matrix.","solutions":["Prefer ayatana on modern distros: set TAURI_LINUX_AYATANA_APPINDICATOR=1 (or unset it, letting the CLI auto-detect ayatana first).","If you truly need libappindicator (legacy targets), install its dev package: `sudo apt-get install -y pkg-config libappindicator3-dev`.","Verify with `pkg-config --libs-only-L appindicator3-0.1`.","Audit your CI/Docker env for stale TAURI_LINUX_AYATANA_APPINDICATOR values."],"exampleFix":"# before: forces removed legacy lib -> panic\nenv:\n  TAURI_LINUX_AYATANA_APPINDICATOR: 'false'\n\n# after\nenv:\n  TAURI_LINUX_AYATANA_APPINDICATOR: '1'","handlingStrategy":"validation","validationCode":"# Decide tray backend explicitly and verify before building\nif [ \"${TAURI_LINUX_AYATANA_APPINDICATOR:-}\" != \"true\" ] && [ \"${TAURI_LINUX_AYATANA_APPINDICATOR:-}\" != \"1\" ]; then\n  pkg-config --libs-only-L appindicator3-0.1 | grep -q -- '-L' || {\n    echo 'set TAURI_LINUX_AYATANA_APPINDICATOR=1 or install libappindicator3-dev'; exit 1;\n  }\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["On Ubuntu 22.04+/Debian 12+ always set TAURI_LINUX_AYATANA_APPINDICATOR=1 or unset it — legacy libappindicator is gone.","Audit CI/Docker env for stale tray backend variables when upgrading base images.","Prefer relying on the CLI's auto-detection (no env var) unless you have a hard requirement."],"tags":["linux","pkg-config","appindicator","tray-icon","tauri-bundler","environment"],"backgroundTag":"pkg-config-library-not-found","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}