tauri-apps/tauri

[bug] How to initiate a network request on the release apk for android platform

Closed this issue · 1 comments

vfiee commented

Describe the bug

Unable to properly initiate network request on release apk

Reproduction

tauri-android-demo

pnpm install
pnpm tauri android build --apk
adb install -r ./src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk
# run the app and click the button to dispatch the request

Screenshot_20240920-174214_android-demo

Expected behavior

期望正常发起请求

Full tauri info output

[✔] Environment
    - OS: Mac OS 15.0.0 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.79.0 (129f3b996 2024-06-10)
    ✔ cargo: 1.79.0 (ffa9cf99a 2024-06-03)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 18.20.2
    - pnpm: 9.10.0
    - yarn: 1.22.22
    - npm: 10.5.0
    - bun: 1.1.26

[-] Packages
    - tauri 🦀: 2.0.0-rc.15
    - tauri-build 🦀: 2.0.0-rc.12
    - wry 🦀: 0.43.1
    - tao 🦀: 0.30.1
    - @tauri-apps/api : 2.0.0-rc.5
    - @tauri-apps/cli : 2.0.0-rc.16

[-] Plugins
    - tauri-plugin-http 🦀: 2.0.0-rc.5
    - @tauri-apps/plugin-http : 2.0.0-rc.2
    - tauri-plugin-shell 🦀: 2.0.0-rc.3
    - @tauri-apps/plugin-shell : 2.0.0-rc.1
    - tauri-plugin-fs 🦀: 2.0.0-rc.5
    - @tauri-apps/plugin-fs : not installed!

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

Stack trace

No response

Additional context

No response

I'm fixing the bug on tauri-invoke-http. Note that you might not even need that plugin btw.
The http plugin still couldn't reach your API, maybe it's not handling properly requests that do not contain the JS headers?