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][v2][android] Failed to create a symbolic link #10937

Open
Theo-Rige opened this issue Sep 9, 2024 · 7 comments
Open

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

Theo-Rige opened this issue Sep 9, 2024 · 7 comments
Labels
platform: Android platform: Windows scope: cli.rs The tauri-cli rust crate status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes type: bug

Comments

@Theo-Rige
Copy link

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

@Theo-Rige Theo-Rige added status: needs triage This issue needs to triage, applied to new issues type: bug labels Sep 9, 2024
@tweidinger
Copy link
Contributor

tweidinger commented Sep 17, 2024

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?

@tweidinger tweidinger added status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes scope: cli.rs The tauri-cli rust crate and removed status: needs triage This issue needs to triage, applied to new issues labels Sep 17, 2024
@Theo-Rige
Copy link
Author

Theo-Rige commented Sep 17, 2024

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
Copy link
Contributor

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
Copy link
Member

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.

@michael-mm-l
Copy link

I'm on Windows 10, when i run "npm run tauri android dev" command that return this error :
symlinking lib "D:\project\Android\android-rust\src-tauri\target\x86_64-linux-android\debug\libandroid_rust_lib.so" in jniLibs dir "D:\project\Android\android-rust\src-tauri\gen/android\app/src/main/jniLibs/x86_64"
Failed to create a symbolic link from "D:\project\Android\android-rust\src-tauri\target\x86_64-linux-android\debug\libandroid_rust_lib.so" to file "D:\project\Android\android-rust\src-tauri\gen/android\app/src/main/jniLibs/x86_64\libandroid_rust_lib.so" (file clobbering enabled): IO
error: 拒绝访问。 (os error 5)

tauri info :
[✔] Environment
- OS: Windows 10.0.19045 x86_64 (X64)
✔ WebView2: 129.0.2792.79
✔ MSVC: Visual Studio 生成工具 2022
✔ rustc: 1.80.0 (051478957 2024-07-21)
✔ cargo: 1.80.0 (376290515 2024-07-16)
✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 20.10.0
- yarn: 1.22.21
- npm: 10.2.3

[-] Packages
- tauri 🦀: 2.0.2
- tauri-build 🦀: 2.0.1
- wry 🦀: 0.44.1
- tao 🦀: 0.30.3
- cargo-tauri 🦀: 1.0.0
- @tauri-apps/api : 2.0.2
- @tauri-apps/cli : 2.0.2

@tweidinger
Copy link
Contributor

It worked for me once I enabled windows developer mode. I only used a single partition/drive though.

@reervlftmd
Copy link

I'm experiencing a similar issue when running npm run tauri android dev on Windows 11. The error message is:

VITE v5.4.10  ready in 5034 ms

  ➜  Local:   http://localhost:1420/
   Compiling tauri v2.0.6
   Compiling tauri-plugin-shell v2.0.2
   Compiling deep v0.1.0 (C:\tauri_projects\deep\src-tauri)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 46.20s
    Info symlinking lib "C:\\tauri_projects\\deep\\src-tauri\\target\\x86_64-linux-android\\debug\\libdeep_lib.so" in jniLibs dir "C:\\tauri_projects\\deep\\src-tauri\\gen/android\\app/src/main/jniLibs/x86_64"
Failed to create a symbolic link from "C:\\tauri_projects\\deep\\src-tauri\\target\\x86_64-linux-android\\debug\\libdeep_lib.so" to file "C:\\tauri_projects\\deep\\src-tauri\\gen/android\\app/src/main/jniLibs/x86_64\\libdeep_lib.so" (file clobbering enabled): IO error: Cannot create a file when that file already exists. (os error 183)
    Error Failed to create a symbolic link from "C:\\tauri_projects\\deep\\src-tauri\\target\\x86_64-linux-android\\debug\\libdeep_lib.so" to file "C:\\tauri_projects\\deep\\src-tauri\\gen/android\\app/src/main/jniLibs/x86_64\\libdeep_lib.so" (file clobbering enabled): IO error: Cannot create a file when that file already exists. (os error 183)

Project Setup:

I created the project using npm create tauri-app@latest.
During setup, I selected Svelte and TypeScript as the framework and language.

tauri info:

[✔] Environment
    - OS: Windows 10.0.26100 x86_64 (X64)
    ✔ WebView2: 130.0.2849.52
    ✔ MSVC:
        - Visual Studio Build Tools 2022
        - Visual Studio Community 2022
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
    ✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 23.1.0
    - npm: 10.9.0
    - bun: 1.1.32
    - deno: deno 1.44.1

[-] 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: ../build
    - devUrl: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite

Attempts to Resolve:

  • Deleted the existing libdeep_lib.so file
  • Ran the terminal as administrator
  • Enabled Windows Developer Mode
  • Turned off Windows Defender to rule out any interference

None of these steps resolved the issue.

Additional Information:

  • Drive Configuration:

    • I have two drives on my system:
      • C: SSD (NTFS format)
      • D: HDD (NTFS format)
    • I attempted to create and run the project on both the C: and D: drives, but the issue occurs on both.
  • Other PC without Partitions:

    • I tested the same project on another PC that doesn't have multiple partitions (only a single drive), and it worked without any issues.

Please let me know if there's any additional information I can provide to help resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Android platform: Windows scope: cli.rs The tauri-cli rust crate status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes type: bug
Projects
None yet
Development

No branches or pull requests

5 participants