tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] Android build on Arch Linux

Open windx-foobar opened this issue 1 year ago • 4 comments

Describe the bug

IDK what am I doing wrong... I am trying to run android development command on my system and am getting various errors. First there was an openssl error. It was solved by specifying OPENSSL_DIR=/usr. Next error occurs

linking with `/home/windx/Android/Sdk/ndk/28.0.12433566/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang` failed: exit status: 1

Next comes a very large note block and the last note block says this

note: ld.lld: error: --fix-cortex-a53-843419 is only supported on AArch64 targets
       clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Manjaro 24.1.1 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.44.4
    ✔ rsvg2: 2.58.4
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.16.0
    - pnpm: 9.12.1
    - npm: 10.8.1
    - bun: 1.1.29

[-] Packages
    - tauri 🦀: 2.0.1
    - tauri-build 🦀: 2.0.1
    - wry 🦀: 0.44.1
    - tao 🦀: 0.30.3
    - tauri-cli 🦀: 2.0.1
    - @tauri-apps/api : 2.0.1 (outdated, latest: 2.0.2)
    - @tauri-apps/cli : 2.0.1 (outdated, latest: 2.0.3)

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.1
    - @tauri-apps/plugin-shell : 2.0.0

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

Stack trace

Stack trace too long. I have attached the file...

Additional context

I'm using bun + vite + ts to frontend compile and runtime. I'm running command OPENSSL_DIR=/usr bun run tauri android dev --open --host stacktrace.txt

windx-foobar avatar Oct 12 '24 17:10 windx-foobar

It was solved by specifying OPENSSL_DIR=/usr

This sounds very wrong to be honest. This would mean you're linking to a Linux openssl version, not an android version of it so i think we should focus on that part instead first. Can you share the error you got before you set OPENSSL_DIR?

FabianLars avatar Oct 13 '24 15:10 FabianLars

It was solved by specifying OPENSSL_DIR=/usr

This sounds very wrong to be honest. This would mean you're linking to a Linux openssl version, not an android version of it so i think we should focus on that part instead first. Can you share the error you got before you set OPENSSL_DIR?

Hi! Thank you for answer.

Ok, i'm trying start with command:

bun run tauri android dev --open

stacktrace_2.txt

windx-foobar avatar Oct 14 '24 21:10 windx-foobar

I think manual add in Cargo.toml->[dependencies]->openssl = { version = "0.10.66", features = ["vendored"] } is the solution to this problem?

windx-foobar avatar Oct 14 '24 21:10 windx-foobar

echo $NDK_HOME
/home/windx/Android/Sdk/ndk/28.0.12433566

windx-foobar avatar Oct 14 '24 21:10 windx-foobar

I think manual add in Cargo.toml->[dependencies]->openssl = { version = "0.10.66", features = ["vendored"] } is the solution to this problem?

Yeah, if that works it should be the easiest solution. An alternative to that would be to try to get rid of all uses of openssl in favor of rustls (most rust crates like reqwest have feature flags to switch)

FabianLars avatar Oct 15 '24 18:10 FabianLars

I think manual add in Cargo.toml->[dependencies]->openssl = { version = "0.10.66", features = ["vendored"] } is the solution to this problem?

Yeah, if that works it should be the easiest solution. An alternative to that would be to try to get rid of all uses of openssl in favor of rustls (most rust crates like reqwest have feature flags to switch)

Hi. Unfortunately, this didn't help. But I'll try your variant with rustls...

windx-foobar avatar Oct 22 '24 10:10 windx-foobar