{"record":{"id":"3f2ef7249d1845be","repo":"tauri-apps/tauri","slug":"failed-to-read-plist","errorCode":null,"errorMessage":"failed to read plist {}: {}","messagePattern":"failed to read plist (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-codegen/src/context.rs","lineNumber":306,"sourceCode":"\n  let with_tray_icon_code = if target.is_desktop() {\n    if let Some(tray) = &config.app.tray_icon {\n      let tray_icon_icon_path = config_parent.join(&tray.icon_path);\n      let icon = CachedIcon::new(&root, &tray_icon_icon_path)?;\n      quote!(context.set_tray_icon(::std::option::Option::Some(#icon));)\n    } else {\n      quote!()\n    }\n  } else {\n    quote!()\n  };\n\n  #[cfg(target_os = \"macos\")]\n  let maybe_embed_plist_block = if target == Target::MacOS && dev && !running_tests {\n    let info_plist_path = config_parent.join(\"Info.plist\");\n    let mut info_plist = if info_plist_path.exists() {\n      plist::Value::from_file(&info_plist_path)\n        .unwrap_or_else(|e| panic!(\"failed to read plist {}: {}\", info_plist_path.display(), e))\n    } else {\n      plist::Value::Dictionary(Default::default())\n    };\n\n    if let Some(plist) = info_plist.as_dictionary_mut() {\n      if let Some(bundle_name) = config\n        .bundle\n        .macos\n        .bundle_name\n        .as_ref()\n        .or(config.product_name.as_ref())\n      {\n        plist.insert(\"CFBundleName\".into(), bundle_name.as_str().into());\n      }\n\n      if let Some(version) = &config.version {\n        let bundle_version = &config.bundle.macos.bundle_version;\n        plist.insert(\"CFBundleShortVersionString\".into(), version.clone().into());","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-codegen/src/context.rs#L288-L324","documentation":"This panic occurs at build time in tauri-codegen when the macOS Info.plist file exists but cannot be parsed as a plist. The codegen step reads Info.plist from the config parent directory to inject isolation-related entries (e.g. bundle name) into the embedded asset context. A malformed, corrupt, or unreadable plist aborts the Rust macro expansion.","triggerScenarios":"Building a Tauri v2 project for macOS in dev mode (not tests) where src-tauri/Info.plist exists but plist::Value::from_file fails: invalid XML syntax, wrong encoding, binary plist format not supported, or the file is unreadable.","commonSituations":"Hand-edited Info.plist with broken XML; a placeholder/empty Info.plist file; a binary-format plist generated by Xcode; file permission problems; committing a truncated plist to the repo.","solutions":["Validate Info.plist with `plutil -lint src-tauri/Info.plist` and fix the reported XML/syntax errors","Ensure the file is XML plist format, not binary (convert with `plutil -convert xml1 Info.plist`)","Check file read permissions for the build process","Temporarily rename/delete Info.plist to confirm it is the cause; recreate it from a known-good template","Update tauri-codegen and the plist crate in case of a parser bug"],"exampleFix":"// before (broken plist)\n<?xml version=\"1.0\"?><plist version=\"1.0\"><dict><key>CFBundleName</key></dict></plist>\n// after (valid plist)\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\"><dict><key>CFBundleName</key><string>MyApp</string></dict></plist>","handlingStrategy":"validation","validationCode":"import subprocess, sys\nr = subprocess.run(['plutil', '-lint', 'src-tauri/Info.plist'], capture_output=True, text=True)\nif r.returncode != 0:\n    sys.exit(f'Invalid plist: {r.stdout}')","typeGuard":"const isXmlPlist = (s: string) => s.trimStart().startsWith('<?xml') && s.includes('<plist');","tryCatchPattern":null,"preventionTips":["Lint Info.plist in CI with plutil -lint before building","Keep Info.plist in XML format and under version control with CI diff checks","Validate after every manual edit with plutil"],"tags":["macos","build-time","plist","codegen"],"backgroundTag":"xml-parse-error","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}