[bug] tauri android dev doesn't work OOB on real devices (can't connect to localhost server)
Closed this issue · 0 comments
Describe the bug
https://discord.com/channels/616186924390023171/986184094050316358/1285544267854647296
https://discord.com/channels/616186924390023171/1282867292216234006
tauri android dev
doesn't work in a plain create-tauri-app out of the box on a real device (did not test emulator) because the app won't be able to connect to the localhost server
Reproduction
- connect real device (didn't test emulator)
- follow prereqs guide(s)
- Create tauri app
- tauri android init
- tauri android dev
- be sad :(
- update vite's server.host setting to 0.0.0.0 and restart
- be happy :)
Expected behavior
The templates should work out of the box, or the docs should mention the prereqs i may be missing.
Full tauri info
output
[✔] Environment
- OS: Windows 10.0.22631 x86_64 (X64)
✔ WebView2: 129.0.2792.52
✔ MSVC: Visual Studio Build Tools 2022
✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
✔ cargo: 1.80.1 (376290515 2024-07-16)
✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 20.17.0
- pnpm: 9.10.0
- npm: 10.8.2
[-] Packages
- tauri 🦀: 2.0.0-rc.15
- tauri-build 🦀: 2.0.0-rc.12
- wry 🦀: 0.44.1
- tao 🦀: 0.30.2
- tauri-cli 🦀: 2.0.0-rc.16
- @tauri-apps/api : 2.0.0-rc.4
- @tauri-apps/cli : 2.0.0-rc.15
[-] Plugins
- tauri-plugin-fs 🦀: 2.0.0-rc.5
- @tauri-apps/plugin-fs : 2.0.0-rc.0 (outdated, latest: 2.0.0-rc.2)
- tauri-plugin-shell 🦀: 2.0.0-rc.3
- @tauri-apps/plugin-shell : 2.0.0-rc.1
[-] App
- build-type: bundle
- CSP: default-src 'self'; image-src data:
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- bundler: Vite
Stack trace
No response
Additional context
https://discord.com/channels/616186924390023171/986184094050316358/1285544267854647296
https://discord.com/channels/616186924390023171/1282867292216234006
(same links as above)
p.s. i am not the only one with this issue but i think it's not an issue for everyone either (may be real device vs emulator then)