{"record":{"id":"f3a4be779ce5cf14","repo":"tauri-apps/tauri","slug":"library-not-found","errorCode":null,"errorMessage":"Library not found: {}","messagePattern":"Library not found: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tauri-build/src/lib.rs","lineNumber":184,"sourceCode":"}\n\n// Copies the macOS application bundle frameworks to the target folder\nfn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> {\n  fs::create_dir_all(dest_dir)\n    .with_context(|| format!(\"Failed to create frameworks output directory at {dest_dir:?}\"))?;\n  for framework in frameworks.iter() {\n    if framework.ends_with(\".framework\") {\n      let src_path = Path::new(framework);\n      let src_name = src_path\n        .file_name()\n        .expect(\"Couldn't get framework filename\");\n      let dest_path = dest_dir.join(src_name);\n      copy_dir(src_path, &dest_path)?;\n      continue;\n    } else if framework.ends_with(\".dylib\") {\n      let src_path = Path::new(framework);\n      if !src_path.exists() {\n        return Err(anyhow::anyhow!(\"Library not found: {}\", framework));\n      }\n      let src_name = src_path.file_name().expect(\"Couldn't get library filename\");\n      let dest_path = dest_dir.join(src_name);\n      copy_file(src_path, &dest_path)?;\n      continue;\n    } else if framework.contains('/') {\n      return Err(anyhow::anyhow!(\n        \"Framework path should have .framework extension: {}\",\n        framework\n      ));\n    }\n    if let Some(home_dir) = dirs::home_dir() {\n      if copy_framework_from(&home_dir.join(\"Library/Frameworks/\"), framework, dest_dir)? {\n        continue;\n      }\n    }\n    if copy_framework_from(\"/Library/Frameworks/\".as_ref(), framework, dest_dir)?\n      || copy_framework_from(\"/Network/Library/Frameworks/\".as_ref(), framework, dest_dir)?","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/tauri-apps/tauri/blob/2f1cd75b0f3fb72e6870d719bbfeadedcf8ca884/crates/tauri-build/src/lib.rs#L166-L202","documentation":"On macOS, tauri-build processes each entry of bundle.macOS.frameworks: entries ending in .framework are copied as directories, and entries ending in .dylib are treated as literal file paths. This error fires when a .dylib entry's path does not exist on disk before copy_file runs.","triggerScenarios":"Building on macOS with bundle.macOS.frameworks containing a '.dylib'-suffixed path (relative or absolute) that is not present at build time - typo'd path, dylib produced by another crate or prebuild step that never ran, or path relative to the wrong working directory.","commonSituations":"Linking a dylib built by a workspace crate whose build step hasn't run; absolute paths valid on one machine but not CI; moving dylibs without updating tauri.conf.json.","solutions":["Fix the path in tauri.conf.json so it resolves to the existing .dylib file","Generate/compile the dylib before tauri build (hook it into beforeBuildCommand if it is a build artifact)","If you meant a system-installed framework, use a bare name (no slash) or a .framework path instead of a .dylib path"],"exampleFix":"// before\n\"macOS\": { \"frameworks\": [\"lib/native/libmylib.dylib\"] }  // file missing\n\n// after\n\"macOS\": { \"frameworks\": [\"libs/libmylib.dylib\"] }  // path exists","handlingStrategy":"validation","validationCode":"# prebuild check: every .dylib frameworks entry must exist\nfor p in $(jq -r '.bundle.macOS.frameworks[]?' src-tauri/tauri.conf.json 2>/dev/null | grep '\\.dylib$'); do\n  [ -f \"src-tauri/$p\" ] || echo \"missing dylib: $p\"\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate dylibs in beforeBuildCommand so they exist before tauri build","Use repo-relative paths, not machine-specific absolute paths","CI on a clean checkout will catch paths that only exist on dev machines - run it before release"],"tags":["macos","frameworks","dylib","tauri-build","config"],"backgroundTag":null,"analyzedSha":"2f1cd75b0f3fb72e6870d719bbfeadedcf8ca884","analyzedAt":"2026-08-16T04:18:42.486Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}