tauri-apps / tauri

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

[bug] Custom attribute panicked at tauri::mobile_entry_point, not compiling for mobile devices #11443

Open jaxmatrix opened 5 days ago

jaxmatrix commented 5 days ago

Describe the bug

I wanted to try tauri development for a project, for which I followed the steps in getting started on tauri page. After setting up the android environment and created a project from template using npm create tauri-app@latest.

I ran npm run tauri android init followed by npm run tauri android dev

that resulted in the following error

   Compiling wry v0.46.3
   Compiling tauri v2.0.6
   Compiling tauri-plugin-shell v2.0.2
   Compiling asdfasdf v0.1.0 (/home/xm/Documents/Experiments/React_Applications/asdfasdf/src-tauri)
   Compiling tauri-runtime-wry v2.1.2

error: custom attribute panicked
 --> src/lib.rs:7:20
  |
7 | #[cfg_attr(mobile, tauri::mobile_entry_point)]
  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: message: `""` is not a valid identifier

error: could not compile `asdfasdf` (lib) due to 1 previous error
`Failed to run `cargo build`: command ["cargo", "build", "--package", "asdfasdf", "--manifest-path", "/home/xm/Documents/Experiments/React_Applications/asdfasdf/src-tauri/Cargo.toml", "--target
", "aarch64-linux-android", "--lib"] exited with code 101
    Error `Failed to run `cargo build`: command ["cargo", "build", "--package", "asdfasdf", "--manifest-path", "/home/xm/Documents/Experiments/React_Applications/asdfasdf/src-tauri/Cargo.toml",
 "--target", "aarch64-linux-android", "--lib"] exited with code 101

Reproduction

No response

Expected behavior

No response

Full tauri info output

> asdfasdf@0.1.0 tauri
> tauri info

[✔] Environment
    - OS: Arch Linux Rolling Release x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.46.1
    ✔ rsvg2: 2.59.1
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
    ✔ cargo: 1.80.1 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.14.0
    - yarn: 1.22.22
    - npm: 10.7.0
    - bun: 1.1.8

[-] Packages
    - tauri 🦀: 2.0.6
    - tauri-build 🦀: 2.0.2
    - wry 🦀: 0.46.3
    - tao 🦀: 0.30.3
    - @tauri-apps/api : 2.0.3
    - @tauri-apps/cli : 2.0.5

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.2
    - @tauri-apps/plugin-shell : 2.0.1

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist/asdfasdf/browser
    - devUrl: http://0.0.0.0:1420/
    - framework: Angular
    - bundler: Webpack

Stack trace

NA

Additional context

Here I just created a new projected without changing the source code of template wanted to test it on android device. Note this works if i run npm tauri dev without issues

semicolon-10 commented 5 days ago

You should be using invalid unique identifier, I just run into same issue couple days back.. Unique identifier should no contain special characters like - etc.. it should be like com.example.app