tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.19k stars 2.42k forks source link

[bug] Tauri configuration file for Android is not detected on Linux #7785

Closed i-c-b closed 11 months ago

i-c-b commented 11 months ago

Describe the bug

When developing on Linux, the Android platform-specific Tauri configuration file is ignored and the Linux one is applied instead.

Reproduction

cargo install create-tauri-app "tauri-cli@^2.0.0-alpha"
cargo create-tauri-app -m cargo -t vanilla --alpha --mobile tauri-app
cd tauri-app
cargo tauri android init

Modify tauri.conf.json with "beforeDevCommand": "echo \"tauri.conf.json\"". Create tauri.android.conf.json with { "build": { "beforeDevCommand": "echo \"tauri.android.conf.json\"" } }. Create tauri.linux.conf.json with { "build": { "beforeDevCommand": "echo \"tauri.linux.conf.json\"" } }.

cargo tauri android dev

Expected behavior

Console prints tauri.android.conf.json before building.

Platform and versions

[✔] Environment
    - OS: Linux Mint 21.2 X64
    ✔ webkit2gtk-4.1: 2.40.5
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.72.0 (5680fa18f 2023-08-23)
    ✔ Cargo: 1.72.0 (103a7ff2e 2023-08-15)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 18.17.0
    - pnpm: 8.6.6
    - yarn: 1.22.19
    - npm: 9.6.7

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.12
    - tauri-build [RUST]: 2.0.0-alpha.8
    - wry [RUST]: 0.32.0
    - tao [RUST]: 0.22.2
    - @tauri-apps/api [NPM]: not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.12

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../src
    - devPath: ../src

Stack trace

No response

Additional context

No response

i-c-b commented 11 months ago

I also spotted that the file format for the JSON5 and casing for the TOML Tauri configuration files is different for mobile when compared to the desktop counterparts. I've already created a branch to resolve that issue in my fork but I've delayed submitting the pull request since I'm unsure about whether it classifies as a major version bump while 2.0 is in alpha and spotted this issue. Input on the matter would be appreciated.

FabianLars commented 11 months ago

I've already created a branch to resolve that issue in my fork but I've delayed submitting the pull request since I'm unsure about whether it classifies as a major version bump while 2.0 is in alpha and spotted this issue. Input on the matter would be appreciated.

Yeah, sounds like something that should be fixed while it's still in alpha (every alpha release can contain breaking changes so that's alright). So we'd appreciate the PR :)