Skip to content

[bug] Android gen doesn't escape single quote character #14634

@setoelkahfi

Description

@setoelkahfi

Describe the bug

If an productName has a single quote character, the generated strings.xml file for Android Studio project doesn't escape the character. This will make the build fails.

Reproduction

  1. Create a new Tauri app.
  2. Create a product name with single quote:
{
  "productName": "Aircraft's Hub",
  "identifier": "xyz.smbcloud.aircraftshub",
  "version": "1.0.0",
  "bundle": {
    "android": {
      "minSdkVersion": 24,
      "versionCode": 1
    }
  }
}
  1. Generate Android project: cargo tauri android init
  2. Build Android target.
  3. Fail.

Generated strings.xml:

<resources>
    <string name="app_name">Aircraft's Hub</string>
    <string name="main_activity_title">Aircraft's Hub</string>
</resources>

Expected behavior

<resources>
    <string name="app_name">Aircraft\'s Hub</string>
    <string name="main_activity_title">Aircraft\'s Hub</string>
</resources>

Full tauri info output

➜  aircraftshub git:(release/ios) ✗ cargo tauri info

[✔] Environment
    - OS: Mac OS 26.1.0 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ Xcode: 26.0
    ✔ rustc: 1.90.0 (1159e78c4 2025-09-14)
    ✔ cargo: 1.90.0 (840b83a10 2025-07-30)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (overridden by environment variable RUSTUP_TOOLCHAIN)
    - node: 24.9.0
    - pnpm: 10.24.0
    - yarn: 1.22.22
    - npm: 11.6.0
    - bun: 1.3.3
    - deno: deno 2.5.6

[-] Packages
    - tauri 🦀: 2.9.4
    - tauri-build 🦀: 2.5.3
    - wry 🦀: 0.53.5
    - tao 🦀: 0.34.5
    - tauri-cli 🦀: 2.9.4 (outdated, latest: 2.9.5)
    - @tauri-apps/api  ⱼₛ: 2.9.1
    - @tauri-apps/cli  ⱼₛ: 2.9.4 (outdated, latest: 2.9.5)

[-] Plugins
    - tauri-plugin-haptics 🦀: 2.3.2
    - @tauri-apps/plugin-haptics  ⱼₛ: 2.3.2
    - tauri-plugin-os 🦀: 2.3.2
    - @tauri-apps/plugin-os  ⱼₛ: 2.3.2
    - tauri-plugin-log 🦀: 2.7.1
    - @tauri-apps/plugin-log  ⱼₛ: 2.7.1
    - tauri-plugin-store 🦀: 2.4.1
    - @tauri-apps/plugin-store  ⱼₛ: 2.4.1
    - tauri-plugin-opener 🦀: 2.5.2
    - @tauri-apps/plugin-opener  ⱼₛ: 2.5.2

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace


Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions