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] Android os error 2 with sidecar #9774

Open
lindongchen opened this issue May 14, 2024 · 6 comments
Open

[bug] Android os error 2 with sidecar #9774

lindongchen opened this issue May 14, 2024 · 6 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@lindongchen
Copy link

lindongchen commented May 14, 2024

Describe the bug

Error: Uncaught (in promise) No such file or directory (os error 2)
Event: Command.sidecar("bin/pipy", args) ...call sidecar
Sidecar position: src-tauri/bin/pipy-aarch64-linux-android
Sidecar package position: src-tauri/target/aarch64-linux-android/debug/pipy
Sidecar bundle: tauri.conf.json => bundle > "externalBin": ["bin/pipy"]

Simply put, I saw that the sidecar had been packaged in a reasonable location, but when running on the Android emulator, I couldn't find the file. What I can confirm is that other programs can run as usual, and on Mac OS and Windows, my sidecar still works as usual, but it can't be found on the Android emulator

Here is my Cargo.toml configuration:

[lib]
name = "ztm_lib"
crate-type = ["lib", "cdylib", "staticlib"]

[build-dependencies]
tauri-build = { version = "2.0.0-beta", features = [] }

# tauri = { version = "2.0.0-beta", features = ["devtools"] }
[dependencies]
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs" }
tauri = { version = "=2.0.0-beta.19", features = [] }
tauri-plugin-shell = "2.0.0-beta.4"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-plugin-process = "2.0.0-beta.3"
tauri-plugin-http = "2.0.0-beta.3"
tauri-plugin-os = "2.0.0-beta.3"
tauri-plugin-fs = "=2.0.0-beta.7"

[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
tauri-plugin-cli = "2.0.0-beta"

[target.'cfg(any(target_os = "android"))']
linker = "~/Library/Android/sdk/ndk/27.0.11718014/toolchains/llvm/prebuilt/darwin-x86_64/bin"

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 12.0.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.77.0 (aedd173a2 2024-03-17)
    ✔ cargo: 1.77.0 (3fe68eabf 2024-02-29)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 21.7.1
    - pnpm: 8.10.5
    - yarn: 1.22.17
    - npm: 6.14.17

[-] Packages
    - tauri [RUST]: 2.0.0-beta.19
    - tauri-build [RUST]: 2.0.0-beta.15
    - wry [RUST]: 0.39.5
    - tao [RUST]: 0.28.0
    - @tauri-apps/api [NPM]: 2.0.0-beta.11
    - @tauri-apps/cli [NPM]: 2.0.0-beta.17

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../../agent/gui
    - devUrl: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite

Stack trace

No response

Additional context

No response

@lindongchen lindongchen added status: needs triage This issue needs to triage, applied to new issues type: bug labels May 14, 2024
@FabianLars
Copy link
Member

As far as i know, sidecars are simply not supported on mobile. I hope we can improve the errors somehow though 🤔

@lindongchen
Copy link
Author

Can I call it with a rust code snippet like this Command::new("./src-tauri/bin/pipy")

@FabianLars
Copy link
Member

I don't think the binary is even included in the apk/aab so no. In a general sense, the path must point to where the file is after installation, so no src-tauri mention.

@lindongchen
Copy link
Author

Thanks, I understand that.
Will the upcoming version plan to fix this issue? Or you have any other suggestions

@FabianLars
Copy link
Member

It's not planned right now but it's not a definite "no, never" yet. Either way I doubt that it will be part of the initial 2.0 Release.

@lindongchen
Copy link
Author

b503b5f4-f541-46bd-a0ca-f6f2fe64ff99 When I manually copy the binary to **src-tauri/gen/android/app/src/main/assets**, it can be displayed in **Android Studio**, so can I try calling it using Command.sidecar or Command.create?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants