-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
tauri android init internal error: entered unreachable code: abs_src and abs_dest have no common root #8531
Comments
Can you please share your project structure? |
I meet the same problem. |
Please provide steps to reproduce and |
Hi I have the same issue when I am running [-] Packages [-] App |
I'm getting the same error in windows when my project isn't on disk C: When the project is on C: - one of the messages says
So looks like it's trying to get a relative path from your project to nodejs executable. On windows, if they are both on different disks - this is impossible so it panics. tauri info:
|
Same issue. Steps to reproduce: D:\TEMP>yarn create tauri-app --alpha
➤ YN0000: · Yarn 4.1.0
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + create-tauri-app@npm:3.13.3, create-tauri-app-darwin-arm64@npm:3.13.3, and 9 more.
➤ YN0000: └ Completed in 0s 242ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 2 packages were added to the project (+ 1016.2 KiB).
➤ YN0000: └ Completed in 0s 214ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 0s 549ms
warning: The `--alpha` option is now an alias for `--beta` and may be removed in the future.
✔ Project name · tauri-app
✔ Choose which language to use for your frontend · TypeScript / JavaScript - (pnpm, yarn, npm, bun)
✔ Choose your package manager · yarn
✔ Choose your UI template · Svelte - (https://svelte.dev/)
✔ Choose your UI flavor · TypeScript
✔ Would you like to setup the project for mobile as well? · yes
Template created! To get started run:
cd tauri-app
yarn
yarn tauri android init
For Desktop development, run:
yarn tauri dev
For Android development, run:
yarn tauri android dev
D:\TEMP>cd tauri-app
D:\TEMP\tauri-app>code.
'code.' is not recognized as an internal or external command,
operable program or batch file.
D:\TEMP\tauri-app>code . Then in VS Code: PS D:\TEMP\tauri-app> yarn
➤ YN0000: · Yarn 4.1.0
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @sveltejs/vite-plugin-svelte@npm:3.0.2, @tauri-apps/api@npm:2.0.0-beta.0, @tauri-apps/cli@npm:2.0.0-beta.1, @tauri-apps/plugin-shell@npm:2.0.0-beta.0, @tsconfig/svelte@npm:5.0.2, internal-ip@npm:7.0.0, svelte-check@npm:3.6.4, svelte@npm:4.2.10, tslib@npm:2.6.2, and 241 more.
➤ YN0000: └ Completed in 5s 525ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 206 packages were added to the project (+ 117.89 MiB).
➤ YN0000: └ Completed in 2s 881ms
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.19.12 must be built because it never has been before or the last one failed
➤ YN0007: │ svelte-preprocess@npm:5.1.3 [de3c9] must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1s 268ms
➤ YN0000: · Done in 9s 745ms
PS D:\TEMP\tauri-app> yarn tauri android init
thread '<unnamed>' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cargo-mobile2-0.8.0\src\util\path.rs:136:13:
internal error: entered unreachable code: `abs_src` and `abs_dest` have no common root
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
PS D:\TEMP\tauri-app> |
[✔] Environment [-] Packages [-] App |
Could any of you who face this issue provide the directory structure of your drive, if possible with .gitignore if any exists, for example:
|
As i said above, the problem happens when your node executable is not on the same drive as your project. For me tauri project is in I have a gitignore in There is no common root between different disks and it crashes with that "entered unreachable code" error. If the project is anywhere on C: it works correctly. |
I have a similar project structure and it worked fine, could you maybe run with |
@amrbashir are you on windows and is your project on a different disk than your nodejs.exe ? The code that panics is here - https://github.com/tauri-apps/cargo-mobile2/blob/dev/src/util/path.rs#L130-L164 To me it looks like it assumes a posix filesystem that has one common root for everything, on windows it's not true so it gets into that "unreachable" branch. |
yes, also not sure why it is trying to find Finally, I can reproduce it, the issue seems to only happen with |
I think it's this code: tauri/tooling/cli/src/mobile/init.rs Lines 107 to 118 in 5a19147
When running from yarn i think it loads the cli as a node module? (through @tauri-apps/cli npm package which then loads @tauri-apps/cli-win32-x64-msvc) so your argv[0] is node.exe |
Thanks @bdew for your help, I made a PR to fix this. |
* fix(cli): fix panic when `android init` using cargo or yarn closes #8531 * clippy * try with fullpath * clippy * move cli * Update test-android.yml * add to path instead * clippy * try moving * use cargo subcommand * delete unused logic [skip ci] * truncate on init [skip ci] * enhance binary/args check * update change files --------- Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Describe the bug
internal error: entered unreachable code: abs_src and abs_dest have no common root
Reproduction
No response
Expected behavior
No response
Full
tauri info
outputStack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: