tauri-apps/tauri · error · tauri_cli::error::Error
{} project directory is outdated because {reason}. Please de
Error message
{} project directory is outdated because {reason}. Please delete {}, run `tauri {} init` and try again. What it means
The second stage of `ensure_init`: the generated project directory exists but checks detect it no longer matches the source of truth in your repo. Known reasons include modifying `[lib.name]` or `[package.name]` in Cargo.toml (the message joins all collected reasons with 'and'). Because the generated project embeds these names, Tauri requires regenerating it.
Source
Thrown at crates/tauri-cli/src/mobile/mod.rs:577
&format!("{xcodeproj_name}_iOS"),
&format!("{}_iOS", app.name()),
),
)
.with_context(|| format!("failed to write {}", pbxproj_path.display()))?;
} else {
project_outdated_reasons
.push("you have modified your [lib.name] or [package.name] in the Cargo.toml file");
}
}
}
// note: pbxproj is synchronied by the dev/build commands
}
}
if !project_outdated_reasons.is_empty() {
let reason = project_outdated_reasons.join(" and ");
crate::error::bail!(
"{} project directory is outdated because {reason}. Please delete {}, run `tauri {} init` and try again.",
target.ide_name(),
project_dir.display(),
target.command_name(),
)
}
Ok(())
}
#[cfg(unix)]
fn ensure_gradlew(project_dir: &std::path::Path) -> Result<()> {
use std::os::unix::fs::PermissionsExt;
let gradlew_path = project_dir.join("gradlew");
if let Ok(metadata) = gradlew_path.metadata() {
let mut permissions = metadata.permissions();
let is_executable = permissions.mode() & 0o111 != 0;View on GitHub (pinned to 52e4b6e71d)
Solutions
- Delete the stale generated directory (e.g. `rm -rf src-tauri/gen/android` or `src-tauri/gen/ios`).
- Re-run `tauri android init` / `tauri ios init` to regenerate with current Cargo.toml values.
- Re-apply any manual customizations you had made inside gen/ (signing configs, entitlements).
- Avoid renaming `[lib.name]`/`package.name` casually; if you must, regenerate immediately after.
Example fix
# before # Cargo.toml: [lib] name = "old_name" -> changed to "new_name" tauri ios dev # error: Xcode project directory is outdated because you have modified your [lib.name]... # after rm -rf src-tauri/gen/ios tauri ios init tauri ios dev
Defensive patterns
Strategy: fallback
Validate before calling
# Detect drift: crate name vs generated project expectations LIB=$(grep -m1 '^name' src-tauri/Cargo.toml | cut -d'"' -f2) grep -rq "$LIB" src-tauri/gen/ios 2>/dev/null || echo "gen project stale - regenerate it"
Prevention
- Treat `tauri <platform> init` as repeatable: after any crate/lib rename, delete gen/<platform> and re-init.
- Keep manual gen/ customizations in a documented patch list so regeneration is cheap.
- Add a CI consistency check comparing Cargo.toml names with the generated project.
When it happens
Trigger: Renaming the crate or the `[lib] name` in src-tauri/Cargo.toml after `tauri <platform> init`; also other drift detected per-platform in `ensure_init` (e.g. AndroidGradle metadata changed). The check collects each mismatch and then bails with all reasons.
Common situations: Renaming the app package mid-development; applying a template rename script; pulling a commit where a teammate renamed the crate but kept gen/ committed; upgrading Tauri versions that changed expected gen contents.
Related errors
- {} project directory {} doesn't exist. Please run `tauri {}
- No external IP detected.
- failed to read missing addr file {}: {e}
- iOS platform not installed
- Android folder already exists
AI-assisted analysis of tauri-apps/tauri@52e4b6e71d (2026-08-20).
Data as JSON: /api/errors/3de592e6ad627bc6.
Report an issue: GitHub.