Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] cargo tauri android init fails if the app identifier contains the "fun" top level domain #9743

Open
Almost-Senseless-Coder opened this issue May 10, 2024 · 2 comments
Labels
platform: Android status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@Almost-Senseless-Coder
Copy link

Describe the bug

Suppose we have an app identifier like fun.game. Then cargo tauri android init fails with the following error message:

thread 'main' panicked at C:\Users\timjb\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-cli-2.0.0-beta.17\src\mobile\mod.rs:322:6:
called `Result::unwrap()` on an `Err` value: DomainInvalid { domain: "fun", cause: ReservedKeyword { keyword: "fun" } }

This shouldn't happen, as fun is a perfectly valid top level domain, just like online, io or garden.

The issue appears to be that for some reason Rust doesn't see fun as a String, but a keyword, which obviously is prohibited.

Reproduction

  • Run cargo create-tauri-app --beta and confirm mobile support.
  • Change the identifier in the tauri.conf.json to fun.game or any other identifier starting with fun.
  • Run cargo tauri android init.

Expected behavior

I'd expect the generation of the Android project to complete successfully.

Full tauri info output

WARNING: no lock files found, defaulting to npm

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 124.0.2478.80
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.80.0-nightly (e82c861d7 2024-05-04)
    ✔ cargo: 1.80.0-nightly (05364cb2f 2024-05-03)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: nightly-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.11.0
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 2.0.0-beta.19
    - tauri-build [RUST]: 2.0.0-beta.15
    - wry [RUST]: 0.39.5
    - tao [RUST]: 0.28.0
    - tauri-cli [RUST]: 2.0.0-beta.17
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-beta.17

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


### Stack trace

```text
thread 'main' panicked at C:\Users\timjb\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-cli-2.0.0-beta.17\src\mobile\mod.rs:322:6:
called `Result::unwrap()` on an `Err` value: DomainInvalid { domain: "fun", cause: ReservedKeyword { keyword: "fun" } }


### Additional context

_No response_
@Almost-Senseless-Coder Almost-Senseless-Coder added status: needs triage This issue needs to triage, applied to new issues type: bug labels May 10, 2024
@pewsheen
Copy link
Contributor

I'm not familiar with Android, but I think that is because fun is a keyword in Kotlin, and will have some problems when building an Android project if it is not escaped properly?

@Almost-Senseless-Coder
Copy link
Author

Almost-Senseless-Coder commented May 16, 2024

I tried it out in Android Studio. Indeed fun.app_name is valid, but gets escaped to `fun`.app_name as the package name.

I'm not sure how to reproduce this in Tauri, or if it's possible to reproduce at all. Writing the app identifier as

"`fun`.app_name"

results in an error because ` isn't ASCII alphanumeric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Android status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants