{"record":{"id":"3fc1dec20e77d992","repo":"tauri-apps/tauri","slug":"the-bundle-identifier-set-in-bundle-identif","errorCode":null,"errorMessage":"The bundle identifier \"{}\" set in `{bundle_identifier_source:?} identifier`. The bundle identifier string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).","messagePattern":"The bundle identifier \"(.+?)\" set in `(.+?) identifier`\\. The bundle identifier string must contain only alphanumeric characters \\(A-Z, a-z, and 0-9\\), hyphens \\(-\\), and periods \\(\\.\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-cli/src/build.rs","lineNumber":183,"sourceCode":"\n  set_current_dir(dirs.tauri).context(\"failed to set current directory\")?;\n\n  let bundle_identifier_source = config\n    .find_bundle_identifier_overwriter()\n    .unwrap_or_else(|| \"tauri.conf.json\".into());\n\n  if config.identifier == \"com.tauri.dev\" {\n    crate::error::bail!(\n      \"You must change the bundle identifier in `{bundle_identifier_source} identifier`. The default value `com.tauri.dev` is not allowed as it must be unique across applications.\",\n    );\n  }\n\n  if config\n    .identifier\n    .chars()\n    .any(|ch| !(ch.is_alphanumeric() || ch == '-' || ch == '.'))\n  {\n    crate::error::bail!(\n      \"The bundle identifier \\\"{}\\\" set in `{bundle_identifier_source:?} identifier`. The bundle identifier string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).\",\n      config.identifier,\n    );\n  }\n\n  if config.identifier.ends_with(\".app\") {\n    log::warn!(\n      \"The bundle identifier \\\"{}\\\" set in `{bundle_identifier_source:?} identifier` ends with `.app`. This is not recommended because it conflicts with the application bundle extension on macOS.\",\n      config.identifier,\n    );\n  }\n\n  if config.product_name.as_deref() == Some(\"tauri-app\") {\n    log::warn!(\n      \"The `productName` is still set to the default value `tauri-app`, it must be unique across applications since it is written into install paths and platform metadata that are expected to be unique to your application, like the Windows installer upgrade code.\"\n    );\n  }\n","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-cli/src/build.rs#L165-L201","documentation":"The second identifier validation: every character of `config.identifier` must be alphanumeric (ASCII A-Z, a-z, 0-9), a hyphen, or a period — the intersection of what macOS, iOS, and Android accept for bundle/application IDs. Any other character (underscore, space, slash, non-ASCII) aborts the build.","triggerScenarios":"Setting `\"identifier\": \"com.my_app\"` (underscore), `\"com.my app\"` (space), or `\"my/app\"` (slash) in `tauri.conf.json` (or a platform override) and running `tauri build`/`tauri dev`.","commonSituations":"Underscores in package names carried over from npm/crate names; spaces from human-readable app titles pasted into the identifier field; team names with non-ASCII characters.","solutions":["Replace invalid characters: use hyphens or drop them, e.g. `com.my_app` -> `com.my-app` or `com.myapp`","Keep the reverse-DNS shape and re-run; note a trailing `.app` only logs a warning (macOS conflict), it does not fail"],"exampleFix":"// before (tauri.conf.json)\n{ \"identifier\": \"com.my_company.my_app\" }\n\n// after\n{ \"identifier\": \"com.my-company.myapp\" }","handlingStrategy":"validation","validationCode":"# validate identifier charset before invoking the CLI\nid=$(jq -r '.identifier' src-tauri/tauri.conf.json)\nif ! [[ \"$id\" =~ ^[A-Za-z0-9.-]+$ ]]; then\n  echo \"identifier '$id' has invalid characters (allowed: A-Z a-z 0-9 - .)\" >&2; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only letters, digits, hyphens, and periods in the identifier — no underscores","Add a config lint (jq regex or a pre-build script) to CI","Beware pasting app titles into the identifier field; it is an ID, not a display name"],"tags":["tauri-cli","config","bundle-identifier","validation","packaging"],"backgroundTag":"invalid-bundle-identifier","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}