{"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/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-codegen/src/context.rs#L288-L324","documentation":"Compile-time panic in tauri-codegen on macOS dev builds. If an Info.plist file sits next to tauri.conf.json, it is parsed with plist::Value::from_file so codegen can merge in bundle settings; a file that exists but cannot be parsed panics with the path and the underlying plist error.","triggerScenarios":"A hand-edited src-tauri/Info.plist with malformed XML (unclosed tags, stray characters, wrong doctype) or a corrupt/binary file the plist crate rejects in this context.","commonSituations":"Manually editing Info.plist instead of using tauri.conf.json bundle > macOS keys; merge conflicts resolved badly; files written with a wrong encoding.","solutions":["Validate the file: `plutil -lint src-tauri/Info.plist` and fix the reported line","Delete the Info.plist to let Tauri generate one from tauri.conf.json (bundle > macOS settings), which is the recommended flow","Keep custom keys minimal and well-formed XML; re-create the file from a known-good template if unsure"],"exampleFix":"# before\nplutil -lint src-tauri/Info.plist   # reports syntax error -> codegen panics\n\n# after\nplutil -lint src-tauri/Info.plist   # 'OK'\n# or simply: rm src-tauri/Info.plist  (configure via tauri.conf.json bundle.macOS)","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n[ -f src-tauri/Info.plist ] && plutil -lint src-tauri/Info.plist # must print OK","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer configuring bundle > macOS in tauri.conf.json over hand-written plist files","Lint any committed Info.plist with plutil -lint in CI on macOS runners","After merge conflicts in Info.plist, always lint before building"],"tags":["macos","plist","tauri-codegen","codegen","config-parse"],"backgroundTag":"config-parse-error","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}