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.71k stars 2.55k forks source link

Unable to build tauri mobile due to space in the Project folder absolute path #8559

Open omkarium opened 10 months ago

omkarium commented 10 months ago

Describe the bug

I followed the below steps to create a Tauri android app after installing the prerequisites following the docs

omkaram@omkaram:~/Pictures/Rust projects/mobile-app$ npm create tauri-app -- --alpha
✔ Project name · Pikoto
✔ Package name · pikoto
✔ Choose which language to use for your frontend · TypeScript / JavaScript - (pnpm, yarn, npm, bun)
✔ Choose your package manager · npm
✔ Choose your UI template · Vanilla
✔ Choose your UI flavor · JavaScript
✔ Would you like to setup the project for mobile as well? · yes

Template created! To get started run:
  cd Pikoto
  npm install
  npm run tauri android init

For Desktop development, run:
  npm run tauri dev

For Android development, run:
  npm run tauri android dev

omkaram@omkaram:~/Pictures/Rust projects/mobile-app$ cd Pikoto
omkaram@omkaram:~/Pictures/Rust projects/mobile-app/Pikoto$ npm install

added 3 packages, and audited 4 packages in 7s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities
omkaram@omkaram:~/Pictures/Rust projects/mobile-app/Pikoto$ npm run tauri android init

> pikoto@0.0.0 tauri
> tauri android init

        Info "/home/omkaram/Pictures/Rust projects/mobile-app/Pikoto/node_modules/.bin/tauri" relative to "/home/omkaram/Pictures/Rust projects/mobile-app/Pikoto/src-tauri" is "../node_modules/.bin/tauri"
Generating Android Studio project...
        Info "/home/omkaram/Pictures/Rust projects/mobile-app/Pikoto/src-tauri" relative to "/home/omkaram/Pictures/Rust projects/mobile-app/Pikoto/src-tauri/gen/android/pikoto" is "../../../"
victory: Project generated successfully!
    Make cool apps! 🌻 🐕 🎉
omkaram@omkaram:~/Pictures/Rust projects/mobile-app/Pikoto$ npm run tauri android dev

> pikoto@0.0.0 tauri
> tauri android dev

        Info Detected connected device: Pixel_3a_API_34_extension_level_7_x86_64 (sdk_gphone64_x86_64) with target "x86_64-linux-android"
        Info Using 192.168.0.108 to access the development server.
        Info detected host target triple "x86_64-unknown-linux-gnu"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/omkaram/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names -L /home/omkaram/Pictures/Rust projects/mobile-app/Pikoto/src-tauri/.cargo -Clink-arg=-landroid -Clink-arg=-llog -Clink-arg=-lOpenSLES --target x86_64-linux-android --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: multiple input filenames provided (first two filenames are `-` and `projects/mobile-app/Pikoto/src-tauri/.cargo`)

       Error `Failed to run `cargo build`: command ["cargo", "build", "--package", "pikoto", "--manifest-path", "/home/omkaram/Pictures/Rust projects/mobile-app/Pikoto/src-tauri/Cargo.toml", "--target", "x86_64-linux-android", "--lib"] exited with code 101`

Reproduction

No response

Expected behavior

No response

Full tauri info output

> tauri android dev

        Info Detected connected device: Pixel_3a_API_34_extension_level_7_x86_64 (sdk_gphone64_x86_64) with target "x86_64-linux-android"
        Info Using 192.168.0.108 to access the development server.
        Info detected host target triple "x86_64-unknown-linux-gnu"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/omkaram/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names -L /home/omkaram/Pictures/Rust projects/mobile-app/Pikoto/src-tauri/.cargo -Clink-arg=-landroid -Clink-arg=-llog -Clink-arg=-lOpenSLES --target x86_64-linux-android --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: multiple input filenames provided (first two filenames are `-` and `projects/mobile-app/Pikoto/src-tauri/.cargo`)

       Error `Failed to run `cargo build`: command ["cargo", "build", "--package", "pikoto", "--manifest-path", "/home/omkaram/Pictures/Rust projects/mobile-app/Pikoto/src-tauri/Cargo.toml", "--target", "x86_64-linux-android", "--lib"] exited with code 101

Stack trace

No response

Additional context

No response

Abubakar1122331 commented 9 months ago

I'm getting the same error. Did you fixed it?

bennekrouf commented 9 months ago

You should switch on rust nightly, then try run "cargo build" from src-tauri folder

Abubakar1122331 commented 8 months ago

You should switch on rust nightly, then try run "cargo build" from src-tauri folder

Didn't Work.

puneetxp commented 8 months ago

it use rustup for that you need to use you need to curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

omkarium commented 6 months ago

@Abubakar1122331 I have taken interest to give it one more try today and I have found that the issue is with having Spaces in the absolute path of the directory. Essentially they have fixed it in the cargo-mobile2 repo but not here in he main repo. Take a look at this. https://github.com/tauri-apps/tauri/issues/6627

omkarium commented 6 months ago

Removing the space fixed my issue but this needs to be fixed if someone is following this guide to create a tauri app.https://beta.tauri.app/guides/create/ image