tauri-apps / tauri

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

[bug][v2][android] Failed to create a symbolic link #10937

Open Theo-Rige opened 2 weeks ago

Theo-Rige commented 2 weeks ago

Describe the bug

I try to create an Android app with Nuxt 3.13.1. I'm on Windows 11, I followed all the Windows and Nuxt 3 prerequisites but when I launch the android dev command and I choose the "Medium_Phone_API_35" emulator I got this error :

Error Failed to create a symbolic link from
"E:\\Projects\\brain\\src-tauri\\target\\aarch64-linux-android\\debug\\libapp_lib.so"
to file
"E:\\Projects\\brain\\src-tauri\\gen/android\\app/src/main/jniLibs/arm64-v8a\\libapp_lib.so"
(file clobbering enabled): IO error: Incorrect function. (os error 1)

Reproduction

  1. Follow the v2 Windows prerequisites
  2. Create a fresh new Nuxt 3 app using npx nuxi@latest init app
  3. Instal Tauri CLI with npm install -D @tauri-apps/cli@next
  4. Init Tauri npx tauri init
  5. Follow the example configuration from https://v2.tauri.app/start/frontend/nuxt/
  6. Try to start the android dev server with npx tauri android dev
  7. Choose the Medium_Phone_API_35 emulator

Expected behavior

The Nuxt start page launched on the emulator, I guess

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 x86_64 (X64)
    ✔ WebView2: 128.0.2739.67
    ✔ MSVC: Visual Studio Build Tools 2022
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.12.2
    - pnpm: 8.8.0
    - yarn: 1.22.19
    - npm: 10.7.0

[-] Packages
    - tauri 🦀: 2.0.0-rc.10
    - tauri-build 🦀: 2.0.0-rc.9
    - wry 🦀: 0.43.1
    - tao 🦀: 0.30.0
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.0.0-rc.12

[-] Plugins

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:3000/
    - framework: Vue.js (Nuxt)
    - bundler: Webpack

Stack trace

Compiled plugins/server.mjs in 8622.28ms
Compiled plugins/client.mjs in 8675.9ms
Compiled types/plugins.d.ts in 9793.97ms
Vite client built in 575ms
Vite server built in 2030ms
warning: hard linking files in the incremental compilation cache failed. copying files instead. consider moving the cache directory to a file system which supports hard linking in session dir
?\E:\Projects\brain\src-tauri\target\x86_64-linux-android\debug\incremental\app_lib-2bc6ctgt3lhcg\s-gzqpludq51-062b9uj-working

warning: `app` (Lib) generated 1 warning
Finished `dev' profile [unoptimized + debuginfo] target(s) in 58.55s
Info symlinking lib "E:\\Projects\\brain\\src-tauri\\target\\x86_64-linux-android\\debug\\libapp_lib.so" in jniLibs dir "E:\\Projects\\brain\\src-tauri\\gen/android\\app/src/main/jniLibs/x86_64"
Nuxt Nitro server built in 27645 ms
Vite client warmed up in 1ms
Error Failed to create a symbolic link from "E:\\Projects\\\brain\\src-tauri\\target\\x86_64-linux-android\\debug\\libapp_lib.so" to file
"E:\\Projects\\brain\\src-tauri\\gen/android\\app/src/main/jniLibs/x86_64\\libapp_lib.so" (file clobbering enabled): I0 error: Incorrect function. (os error 1)

Additional context

No response

tweidinger commented 1 week ago

I think this is a known issue as flutter had the same message reference. We probably also want to handle this error and display Try moving your Tauri project to the same drive as your Tauri CLI or something like this.

@Theo-Rige can you confirm the project is on a different drive than the cli running?

Theo-Rige commented 1 week ago

I think this is a known issue as flutter had the same message reference. We probably also want to handle this error and display Try moving your Tauri project to the same drive as your Tauri CLI or something like this.

@Theo-Rige can you confirm the project is on a different drive than the cli running?

No, my project is on an external drive but at the same location as the CLI.

tweidinger commented 1 week ago

Wondering if the different path segment separators could cause this? gen/android\\app/src/main/jniLibs/x8 mixed with windows \\ in the same path. Idk how windows handles this for symlink creation. @FabianLars do you have a setup to reproduce?

FabianLars commented 1 week ago

do you have a setup to reproduce?

I don't have an external drive with enough space to build a mobile app 😂

But with E:\ being an external drive (assuming they mean something like an usb drive) we already know the issue. fat32 and exfat, the most common formats for those drives, simply do not support symlinks.