tauri-apps/tauri · error
failed to convert APPLE_PROVIDER_SHORT_NAME to string
Error message
failed to convert APPLE_PROVIDER_SHORT_NAME to string
What it means
When bundling for macOS/App Store uploads, the CLI overrides the config's provider short name with the APPLE_PROVIDER_SHORT_NAME environment variable. to_str() returns None when the variable holds non-UTF-8 bytes, and this expect panics. As with the signing identity, only the encoding of the env var matters, not the value.
Source
Thrown at crates/tauri-cli/src/interface/rust.rs:1461
resources.push(path.display().to_string());
}
}
let signing_identity = match std::env::var_os("APPLE_SIGNING_IDENTITY") {
Some(signing_identity) => Some(
signing_identity
.to_str()
.expect("failed to convert APPLE_SIGNING_IDENTITY to string")
.to_string(),
),
None => config.macos.signing_identity,
};
let provider_short_name = match std::env::var_os("APPLE_PROVIDER_SHORT_NAME") {
Some(provider_short_name) => Some(
provider_short_name
.to_str()
.expect("failed to convert APPLE_PROVIDER_SHORT_NAME to string")
.to_string(),
),
None => config.macos.provider_short_name,
};
let (resources, resources_map) = match resources {
BundleResources::List(paths) => (Some(paths), None),
BundleResources::Map(map) => (None, Some(map)),
};
#[cfg(target_os = "macos")]
let entitlements = if let Some(plugin_config) = tauri_config
.plugins
.0
.get("deep-link")
.and_then(|c| c.get("desktop").cloned())
{
let protocols: DesktopDeepLinks =View on GitHub (pinned to 52e4b6e71d)
Solutions
- Check the raw bytes: `env | grep APPLE_PROVIDER_SHORT_NAME | xxd | head`.
- Re-export as clean ASCII: `export APPLE_PROVIDER_SHORT_NAME="MyTeam"`.
- Re-create the CI secret from plain text.
- Confirm the correct value in App Store Connect (Users and Access > keys/providers) before re-adding it.
Example fix
# before export APPLE_PROVIDER_SHORT_NAME=$'Bad\xffName' # after export APPLE_PROVIDER_SHORT_NAME="MyTeamName"
Defensive patterns
Strategy: validation
Validate before calling
# Reject non-UTF-8 before building
python3 - <<'EOF'
import os, sys
v = os.environb.get(b'APPLE_PROVIDER_SHORT_NAME')
if v is not None:
try: v.decode('utf-8')
except UnicodeDecodeError:
sys.exit('APPLE_PROVIDER_SHORT_NAME is not valid UTF-8')
EOF Prevention
- Keep App Store provider names as simple ASCII strings in secrets.
- Re-create (not edit) CI secrets when they were pasted from rich text sources.
- Validate all APPLE_* env vars decode as UTF-8 in a CI preflight step.
When it happens
Trigger: Running `tauri build` (App Store connect flows) with APPLE_PROVIDER_SHORT_NAME exported containing raw non-UTF-8 bytes from a mis-encoded script, secret, or locale-mangled shell profile.
Common situations: CI providers writing secrets with bad encodings; team names copied from web pages with smart quotes or non-breaking spaces in a non-UTF-8 terminal.
Related errors
- failed to convert APPLE_SIGNING_IDENTITY to string
- Android SDK not found. Make sure the SDK and NDK are install
- Invalid SDK root {}
- {error_message}: {e}
- "rustc" could not be found, did you install Rust?
AI-assisted analysis of tauri-apps/tauri@52e4b6e71d (2026-08-20).
Data as JSON: /api/errors/44ebfdff79d71093.
Report an issue: GitHub.