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] Cannot run tauri android dev command #6659

Closed
FlysoftBeta opened this issue Apr 8, 2023 · 7 comments
Closed

[bug] Cannot run tauri android dev command #6659

FlysoftBeta opened this issue Apr 8, 2023 · 7 comments
Labels
platform: Android status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@FlysoftBeta
Copy link
Contributor

Describe the bug

I got the following error when I initialized a mobile app using yarn create tauri-app --alpha

* daemon not running; starting now at tcp:5037
ADB server didn't ACK
Full server startup log: /tmp/adb.1000.log
Server had pid: 24961
--- adb starting (pid 24961) ---
adb I 04-08 14:46:38 24961 24961 main.cpp:63] Android Debug Bridge version 1.0.41
adb I 04-08 14:46:38 24961 24961 main.cpp:63] Version 34.0.1-9680074
adb I 04-08 14:46:38 24961 24961 main.cpp:63] Installed as /home/flysoft/Android/Sdk/platform-tools/adb
adb I 04-08 14:46:38 24961 24961 main.cpp:63] 
adb F 04-08 14:46:38 24961 24961 main.cpp:165] could not install *smartsocket* listener: Address already in use

* failed to start daemon
adb: cannot connect to daemon
       Error Failed to install APK: Command "/home/flysoft/Android/Sdk/platform-tools/adb -s emulator-5554 install /home/flysoft/Desktop/stock/src-tauri/gen/android/stock/app/build/outputs/apk/x86_64/debug/app-x86_64-debug.apk" didn't complete successfully, exiting with code 1.

Reproduction

yarn create tauri-app --alpha
cd my-app
yarn
yarn tauri android init
yarn tauri android dev

Expected behavior

No response

Platform and versions

[✔] Environment
    - OS: Ubuntu 22.04 X64
    ✔ webkit2gtk-4.1: 2.38.5
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.68.1 (8460ca823 2023-03-20)
    ✔ Cargo: 1.68.1 (115f34552 2023-02-26)
    ✔ rustup: 1.25.2 (17db695f1 2023-02-01)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 18.15.0
    - pnpm: 8.1.1
    - yarn: 3.5.0
    - npm: 9.5.0

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.6
    - tauri-build [RUST]: 2.0.0-alpha.3
    - wry [RUST]: 0.27.2
    - tao [RUST]: 0.18.3
    - @tauri-apps/api [NPM]: 2.0.0-alpha.2
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.6

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - bundler: Vite

Stack trace

No response

Additional context

No response

@FlysoftBeta FlysoftBeta added status: needs triage This issue needs to triage, applied to new issues type: bug labels Apr 8, 2023
@amrbashir
Copy link
Member

Seems like adb port is already in-use which means another adb instance is running, try adb kill-server then adb start-server if it didn't work, maybe try this https://stackoverflow.com/a/44586422

@etrnal70
Copy link

I do get this problem if using pnpm tauri android dev. But if i'm using cargo tauri android dev, it works fine. Might be a bug in the js script ?

@amrbashir
Copy link
Member

@etrnal70 what is the version of @tauri-apps/cli you're using? if it is not 2.0.0-alpha.7 then update to 2.0.0-alpha.7 and try again.

@lok52
Copy link

lok52 commented Apr 14, 2023

Getting same issue on macOS

[✔] Environment
    - OS: Mac OS 13.3.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.68.2 (9eb3afe9e 2023-03-27)
    ✔ Cargo: 1.68.2 (6feb7c9cf 2023-03-26)
    ✔ rustup: 1.25.2 (fae52a197 2023-02-01)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (default)
    - node: 18.12.1
    - yarn: 1.22.19
    - npm: 9.6.4

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.8
    - tauri-build [RUST]: 2.0.0-alpha.4
    - wry [RUST]: 0.27.3
    - tao [RUST]: 0.18.3
    - @tauri-apps/api [NPM]: 2.0.0-alpha.3
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.8

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite

@lucasfernog
Copy link
Member

Might be a bug when running with napi-rs, I know I had to change some stdio handles to fix it. I also faced this some time ago, I think running tauri android dev --open also works. I'll see if I still have this problem.

@lucasfernog
Copy link
Member

I can reproduce it. I'm working on the fix.

@lucasfernog
Copy link
Member

As expected, using duct instead of cargo-mobile's bossy wrapper for std::process::Command fixes this. Don't ask me why, I think they do some magic with the stdio handles.

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

No branches or pull requests

6 participants