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][v2][macos] Tauri 2.0 cannot build target android #9582

Open
GOWxx opened this issue Apr 26, 2024 · 5 comments
Open

[bug][v2][macos] Tauri 2.0 cannot build target android #9582

GOWxx opened this issue Apr 26, 2024 · 5 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@GOWxx
Copy link

GOWxx commented Apr 26, 2024

Describe the bug

Running pnpm tauri build --target armv7-linux-androideabi build failed.

Reproduction

create the project according to the instructions at https://v2.tauri.app/start/

cargo install create-tauri-app
cargo create-tauri-app --beta
% cargo create-tauri-app --beta
✔ Project name · my-first-tauri-v2-app-playground
✔ Choose which language to use for your frontend · TypeScript / JavaScript - (pnpm, yarn, npm, bun)
✔ Choose your package manager · pnpm
✔ Choose your UI template · React - (https://react.dev/)
✔ Choose your UI flavor · TypeScript
✔ Would you like to setup the project for mobile as well? · yes

Template created! To get started run:
  cd my-first-tauri-v2-app-playground
  pnpm install
  pnpm tauri android init
  pnpm tauri ios init

For Desktop development, run:
  pnpm tauri dev

For Android development, run:
  pnpm tauri android dev

For iOS development, run:
  pnpm tauri ios dev

Download Android Studio and install dependencies

  • Android SDK Platform
  • Android SDK Platform-Tools
  • NDK (Side by side)
  • Android SDK Build-Tools
  • Android SDK Command-line Tools

Configure environment variables

export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
export ANDROID_HOME="$HOME/Library/Android/sdk"
export NDK_HOME="$ANDROID_HOME/ndk/$(ls -1 $ANDROID_HOME/ndk)"`

Add targets using rustup

rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

% rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
info: component 'rust-std' for target 'aarch64-linux-android' is up to date
info: component 'rust-std' for target 'armv7-linux-androideabi' is up to date
info: component 'rust-std' for target 'i686-linux-android' is up to date
info: component 'rust-std' for target 'x86_64-linux-android' is up to date

Edit tauri.conf.json identifier

Run commmand

pnpm tauri build --target aarch64-linux-android

Encountered an error

error: failed to run custom build command for `openssl-sys v0.9.102`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/my-first-tauri-v2-app-playground/src-tauri/target/release/build/openssl-sys-b1afa1c49831af0f/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=ARMV7_LINUX_ANDROIDEABI_OPENSSL_LIB_DIR
  ARMV7_LINUX_ANDROIDEABI_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=ARMV7_LINUX_ANDROIDEABI_OPENSSL_INCLUDE_DIR
  ARMV7_LINUX_ANDROIDEABI_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=ARMV7_LINUX_ANDROIDEABI_OPENSSL_DIR
  ARMV7_LINUX_ANDROIDEABI_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_armv7-linux-androideabi
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_armv7_linux_androideabi
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_armv7-linux-androideabi
  cargo:rerun-if-env-changed=PKG_CONFIG_armv7_linux_androideabi
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_armv7-linux-androideabi
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_armv7_linux_androideabi
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  run pkg_config fail: pkg-config has not been configured to support cross-compilation.

  Install a sysroot for the target platform and configure it via
  PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a
  cross-compiling wrapper for pkg-config and set it via
  PKG_CONFIG environment variable.

  --- stderr
  thread 'main' panicked at /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.102/build/find_normal.rs:190:5:


  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.
  -recipient-pub-value key    Recipient public key for encryption (hex or base64 X9.63 encoded)
  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = aarch64-apple-darwin
  $TARGET = armv7-linux-androideabi
  openssl-sys = 0.9.102


  stack backtrace:
     0: rust_begin_unwind
               at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647:5
     1: core::panicking::panic_fmt
               at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:72:14
     2: core::panicking::panic_display
     3: build_script_main::find_normal::find_openssl_dir
     4: build_script_main::find_normal::get_openssl::{{closure}}
     5: core::option::Option<T>::unwrap_or_else
     6: build_script_main::find_normal::get_openssl
     7: build_script_main::find_openssl
     8: build_script_main::main
     9: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
    Error failed to build app: failed to build app
 ELIFECYCLE  Command failed with exit code 1.

Expected behavior

Can be compiled into an apk file normally.

Full tauri info output

% pnpm tauri info

> tauri "info"

[✔] Environment
    - OS: Mac OS 14.4.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
    ✔ cargo: 1.77.2 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.10.0
    - pnpm: 8.15.4
    - yarn: 1.22.22
    - npm: 10.2.3
    - bun: 1.1.4

[-] Packages
    - tauri [RUST]: 2.0.0-beta.16
    - tauri-build [RUST]: 2.0.0-beta.13
    - wry [RUST]: 0.39.3
    - tao [RUST]: 0.27.1
    - tauri-cli [RUST]: 2.0.0-alpha.2
    - @tauri-apps/api [NPM]: 2.0.0-beta.9
    - @tauri-apps/cli [NPM]: 2.0.0-beta.13

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

Stack trace

error: failed to run custom build command for `openssl-sys v0.9.102`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/my-first-tauri-v2-app-playground/src-tauri/target/release/build/openssl-sys-b1afa1c49831af0f/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=ARMV7_LINUX_ANDROIDEABI_OPENSSL_LIB_DIR
  ARMV7_LINUX_ANDROIDEABI_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=ARMV7_LINUX_ANDROIDEABI_OPENSSL_INCLUDE_DIR
  ARMV7_LINUX_ANDROIDEABI_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=ARMV7_LINUX_ANDROIDEABI_OPENSSL_DIR
  ARMV7_LINUX_ANDROIDEABI_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_armv7-linux-androideabi
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_armv7_linux_androideabi
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_armv7-linux-androideabi
  cargo:rerun-if-env-changed=PKG_CONFIG_armv7_linux_androideabi
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_armv7-linux-androideabi
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_armv7_linux_androideabi
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  run pkg_config fail: pkg-config has not been configured to support cross-compilation.

  Install a sysroot for the target platform and configure it via
  PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a
  cross-compiling wrapper for pkg-config and set it via
  PKG_CONFIG environment variable.

  --- stderr
  thread 'main' panicked at /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.102/build/find_normal.rs:190:5:


  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = aarch64-apple-darwin
  $TARGET = armv7-linux-androideabi
  openssl-sys = 0.9.102


  stack backtrace:
     0:        0x100a619b0 - std::backtrace_rs::backtrace::libunwind::trace::h89330013351db63c
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
     1:        0x100a619b0 - std::backtrace_rs::backtrace::trace_unsynchronized::hef5ed454b5e9a42a
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
     2:        0x100a619b0 - std::sys_common::backtrace::_print_fmt::h661fed69b93a32f7
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/sys_common/backtrace.rs:68:5
     3:        0x100a619b0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0aa20ca08aeb683c
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/sys_common/backtrace.rs:44:22
     4:        0x100a7c0f8 - core::fmt::rt::Argument::fmt::h0c1f3a7ec00b5b49
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/fmt/rt.rs:142:9
     5:        0x100a7c0f8 - core::fmt::write::h168dbafcf35bac68
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/fmt/mod.rs:1120:17
     6:        0x100a5e4c0 - std::io::Write::write_fmt::hdb0dd3f09dcf2281
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/io/mod.rs:1846:15
     7:        0x100a617e4 - std::sys_common::backtrace::_print::h7d087ee39ce46706
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/sys_common/backtrace.rs:47:5
     8:        0x100a617e4 - std::sys_common::backtrace::print::h57b289e4b951ee17
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/sys_common/backtrace.rs:34:9
     9:        0x100a63234 - std::panicking::default_hook::{{closure}}::h783b6c512154ec65
    10:        0x100a62f7c - std::panicking::default_hook::hcdfa9e1e0f234a4f
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:292:9
    11:        0x100a63670 - std::panicking::rust_panic_with_hook::h9aea678ca49d64cf
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:781:13
    12:        0x100a63564 - std::panicking::begin_panic_handler::{{closure}}::ha16c3377e66deceb
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:659:13
    13:        0x100a61e34 - std::sys_common::backtrace::__rust_end_short_backtrace::hea8fdda1ea8a4c0e
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/sys_common/backtrace.rs:171:18
    14:        0x100a632ec - rust_begin_unwind
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647:5
    15:        0x100a86f00 - core::panicking::panic_fmt::h1cb43b60f5788132
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:72:14
    16:        0x1009915fc - core::panicking::panic_display::h14c34455b67630a6
    17:        0x100993204 - build_script_main::find_normal::find_openssl_dir::h228cc63d84426c27
    18:        0x100992184 - build_script_main::find_normal::get_openssl::{{closure}}::hc9185bbbd10dd2f4
    19:        0x10099116c - core::option::Option<T>::unwrap_or_else::hf11445dded37433c
    20:        0x100992010 - build_script_main::find_normal::get_openssl::hea5155101d855e87
    21:        0x10098aa64 - build_script_main::find_openssl::h3a73f7bc897cc649
    22:        0x10098ae70 - build_script_main::main::hef0c7bbec5e2d914
    23:        0x1009878ac - core::ops::function::FnOnce::call_once::h1f4ac007914ddcf4
    24:        0x1009870ac - std::sys_common::backtrace::__rust_begin_short_backtrace::h8f35a7d8e85db306
    25:        0x100987118 - std::rt::lang_start::{{closure}}::h903414f5d58f9142
    26:        0x100a59dec - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h4ad1988d4a160680
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/ops/function.rs:284:13
    27:        0x100a59dec - std::panicking::try::do_call::h2331bfde8ef4cc3d
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:554:40
    28:        0x100a59dec - std::panicking::try::h8b8bd8b27e4c66f6
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:518:19
    29:        0x100a59dec - std::panic::catch_unwind::hae6cb7ed67951dea
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panic.rs:142:14
    30:        0x100a59dec - std::rt::lang_start_internal::{{closure}}::hd4e8129122b055e2
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/rt.rs:148:48
    31:        0x100a59dec - std::panicking::try::do_call::h6feb7fafe6c6f753
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:554:40
    32:        0x100a59dec - std::panicking::try::h2fa734b49f8484d4
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:518:19
    33:        0x100a59dec - std::panic::catch_unwind::h487a42f5cf6b259f
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panic.rs:142:14
    34:        0x100a59dec - std::rt::lang_start_internal::h0e09503d2b7f298e
                                 at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/rt.rs:148:20
    35:        0x1009870f0 - std::rt::lang_start::h77706db05433be44
    36:        0x10098e61c - _main
warning: build failed, waiting for other jobs to finish...
    Error failed to build app: failed to build app
 ELIFECYCLE  Command failed with exit code 1.

Additional context

No response

@GOWxx GOWxx added status: needs triage This issue needs to triage, applied to new issues type: bug labels Apr 26, 2024
@GOWxx
Copy link
Author

GOWxx commented Apr 26, 2024

Update:

According to the prompt
add OPENSSL_DIR environment variable

% brew info openssl@3
==> openssl@3: stable 3.3.0 (bottled)
Cryptography and SSL/TLS Toolkit
https://openssl.org/
Installed
/opt/homebrew/Cellar/openssl@3/3.3.0 (6,976 files, 32.4MB) *

% export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
% export ANDROID_HOME="$HOME/Library/Android/sdk"
% export NDK_HOME="$ANDROID_HOME/ndk/$(ls -1 $ANDROID_HOME/ndk)"
% export OPENSSL_DIR='/opt/homebrew/Cellar/openssl@3/3.3.0'
The following warnings were emitted during compilation:

warning: openssl-sys@0.9.102: Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `arm-linux-androideabi-clang` installed?

error: failed to run custom build command for `openssl-sys v0.9.102`

Caused by:
  process didn't exit successfully: `/my-first-tauri-v2-app-playground/src-tauri/target/release/build/openssl-sys-b1afa1c49831af0f/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=ARMV7_LINUX_ANDROIDEABI_OPENSSL_LIB_DIR
  ARMV7_LINUX_ANDROIDEABI_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=ARMV7_LINUX_ANDROIDEABI_OPENSSL_INCLUDE_DIR
  ARMV7_LINUX_ANDROIDEABI_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=ARMV7_LINUX_ANDROIDEABI_OPENSSL_DIR
  ARMV7_LINUX_ANDROIDEABI_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR = /opt/homebrew/Cellar/openssl@3/3.3.0
  cargo:rerun-if-changed=/opt/homebrew/Cellar/openssl@3/3.3.0/include/openssl
  cargo:rustc-link-search=native=/opt/homebrew/Cellar/openssl@3/3.3.0/lib
  cargo:include=/opt/homebrew/Cellar/openssl@3/3.3.0/include
  cargo:rerun-if-changed=build/expando.c
  OPT_LEVEL = Some("3")
  TARGET = Some("armv7-linux-androideabi")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_armv7-linux-androideabi
  CC_armv7-linux-androideabi = None
  cargo:rerun-if-env-changed=CC_armv7_linux_androideabi
  CC_armv7_linux_androideabi = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `arm-linux-androideabi-clang` installed?
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_armv7-linux-androideabi
  CFLAGS_armv7-linux-androideabi = None
  cargo:rerun-if-env-changed=CFLAGS_armv7_linux_androideabi
  CFLAGS_armv7_linux_androideabi = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None

  --- stderr
  thread 'main' panicked at /Users/[USERNAME]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.102/build/main.rs:188:13:

  Header expansion error:
  Error { kind: ToolNotFound, message: "Failed to find tool. Is `arm-linux-androideabi-clang` installed?" }

  Failed to find OpenSSL development headers.

  You can try fixing this setting the `OPENSSL_DIR` environment variable
  pointing to your OpenSSL installation or installing OpenSSL headers package
  specific to your distribution:

      # On Ubuntu
      sudo apt-get install libssl-dev
      # On Arch Linux
      sudo pacman -S openssl
      # On Fedora
      sudo dnf install openssl-devel
      # On Alpine Linux
      apk add openssl-dev

  See rust-openssl documentation for more information:

      https://docs.rs/openssl

  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
    Error failed to build app: failed to build app
 ELIFECYCLE  Command failed with exit code 1.

@GOWxx
Copy link
Author

GOWxx commented Apr 26, 2024

Update:

According to
sfackler/rust-openssl#1402 (comment)

The directory containing x86_64-linux-android-clang should be added to your PATH.

Configure environment variables

# .zshrc
# for tauri build
export NDK_HOME="/Users/[username]/Library/Android/sdk/ndk/27.0.11718014"
export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
export ANDROID_HOME="$HOME/Library/Android/sdk"
export NDK_HOME="$ANDROID_HOME/ndk/$(ls -1 $ANDROID_HOME/ndk)"
export OPENSSL_DIR='/opt/homebrew/Cellar/openssl@3/3.3.0'
export PATH="$NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin:$PATH"
# for tauri build

Run build

The issue with openssl seems to have disappeared, but encountered a new problem.

✓ built in 375ms
   Compiling openssl-sys v0.9.102
   Compiling aho-corasick v1.1.3
   Compiling selectors v0.22.0
   Compiling html5ever v0.26.0
   Compiling tracing-core v0.1.32
   Compiling unic-common v0.9.0
   Compiling unic-char-range v0.9.0
   Compiling alloc-no-stdlib v2.0.4
   Compiling futures-task v0.3.30
   Compiling equivalent v1.0.1
   Compiling hashbrown v0.12.3
   Compiling pin-utils v0.1.0
   Compiling hashbrown v0.14.3
   Compiling regex-syntax v0.8.3
   Compiling foreign-types-shared v0.1.1
   Compiling thin-slice v0.1.1
   Compiling crossbeam-utils v0.8.19
   Compiling foreign-types v0.3.2
   Compiling futures-util v0.3.30
   Compiling indexmap v1.9.3
   Compiling indexmap v2.2.6
   Compiling tracing v0.1.40
   Compiling httparse v1.8.0
   Compiling alloc-stdlib v0.2.2
   Compiling unic-char-property v0.9.0
   Compiling unic-ucd-version v0.9.0
   Compiling http-body v1.0.0
   Compiling combine v4.6.7
   Compiling serde_spanned v0.6.5
   Compiling toml_datetime v0.6.3
   Compiling try-lock v0.2.5
   Compiling cesu8 v1.1.0
   Compiling regex-automata v0.4.6
   Compiling winnow v0.5.40
   Compiling uuid v1.8.0
   Compiling semver v1.0.22
   Compiling cfb v0.7.3
   Compiling kuchikiki v0.8.2
   Compiling want v0.3.1
   Compiling pin-project v1.1.5
   Compiling unic-ucd-ident v0.9.0
   Compiling num_enum v0.5.11
   Compiling brotli-decompressor v2.5.1
   Compiling toml_edit v0.20.2
   Compiling regex v1.10.4
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling ndk-sys v0.4.1+23.1.7779620
   Compiling treediff v4.0.3
   Compiling openssl v0.10.64
   Compiling jni v0.21.1
   Compiling native-tls v0.2.11
   Compiling futures-channel v0.3.30
   Compiling phf_shared v0.11.2
   Compiling dpi v0.1.1
   Compiling base64 v0.22.0
   Compiling raw-window-handle v0.6.1
   Compiling raw-window-handle v0.5.2
   Compiling openssl-probe v0.1.5
   Compiling same-file v1.0.6
   Compiling tower-layer v0.3.2
   Compiling tower-service v0.3.2
   Compiling walkdir v2.5.0
   Compiling ndk v0.7.0
   Compiling tower v0.4.13
   Compiling phf v0.11.2
   Compiling hyper v1.3.1
   Compiling json-patch v1.2.0
   Compiling toml v0.8.2
   Compiling digest v0.10.7
   Compiling crossbeam-channel v0.5.12
   Compiling urlpattern v0.2.0
   Compiling brotli v3.5.0
   Compiling infer v0.15.0
   Compiling serde_with v3.8.0
   Compiling dunce v1.0.4
   Compiling glob v0.3.1
   Compiling cpufeatures v0.2.12
   Compiling ndk-context v0.1.1
   Compiling tauri-runtime v2.0.0-beta.13
   Compiling wry v0.39.3
   Compiling sha2 v0.10.8
   Compiling tauri v2.0.0-beta.16
   Compiling tokio-native-tls v0.3.1
   Compiling hyper-util v0.1.3
   Compiling http-body-util v0.1.1
   Compiling instant v0.1.12
   Compiling futures-sink v0.3.30
   Compiling rustls-pki-types v1.5.0
   Compiling lazy_static v1.4.0
   Compiling tauri-codegen v2.0.0-beta.13
   Compiling rustls-pemfile v2.1.2
   Compiling hyper-tls v0.6.0
   Compiling tauri-utils v2.0.0-beta.13
   Compiling tao v0.27.1
   Compiling tokio-util v0.7.10
   Compiling tauri-runtime-wry v2.0.0-beta.13
   Compiling tauri-plugin-shell v2.0.0-beta.3
   Compiling serde_urlencoded v0.7.1
   Compiling anyhow v1.0.82
   Compiling is-docker v0.2.0
   Compiling serialize-to-javascript-impl v0.1.1
   Compiling dirs-sys-next v0.1.2
   Compiling schemars v0.8.16
   Compiling ipnet v2.9.0
   Compiling mime v0.3.17
   Compiling sync_wrapper v0.1.2
   Compiling reqwest v0.12.4
   Compiling serialize-to-javascript v0.1.1
   Compiling dirs-next v2.0.0
   Compiling tauri-macros v2.0.0-beta.13
   Compiling is-wsl v0.4.0
   Compiling getrandom v0.2.14
   Compiling serde_repr v0.1.19
   Compiling dyn-clone v1.0.17
   Compiling state v0.6.0
   Compiling heck v0.4.1
   Compiling pathdiff v0.2.1
   Compiling my-first-tauri-v2-app-playground v0.0.0 (/my-first-tauri-v2-app-playground/src-tauri)
   Compiling open v5.1.2
   Compiling encoding_rs v0.8.34
   Compiling shared_child v1.0.0
   Compiling os_pipe v1.1.5
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/my-first-tauri-v2-app-playground/node_modules/.bin:/Users/username/Library/pnpm/global/5/.pnpm/pnpm@8.15.4/node_modules/pnpm/dist/node-gyp-bin:/deps/depot_tools:/opt/homebrew/opt/postgresql@15/bin:/Users/username/Library/Android/sdk/ndk/27.0.11718014/toolchains/llvm/prebuilt/darwin-x86_64/bin:/Users/username/Library/pnpm:/opt/homebrew/opt/openjdk/bin:/Users/username/.pyenv/shims:/deps/depot_tools:/opt/homebrew/opt/postgresql@15/bin:%NDK_HOME:/Users/username/Library/pnpm:/opt/homebrew/opt/openjdk/bin:/deps/depot_tools:/opt/homebrew/opt/postgresql@15/bin:/Users/username/Library/pnpm:/opt/homebrew/opt/openjdk/bin:/Users/username/.nvm/versions/node/v20.10.0/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Little Snitch.app/Contents/Components:/Users/username/.cargo/bin:/Applications/kitty.app/Contents/MacOS:/Users/username/.local/bin:/Users/username/.orbstack/bin:/Users/username/Library/Android/sdk/emulator:/Users/username/Library/Android/sdk/platform-tools:/Users/username/Library/Android/sdk/emulator:/Users/username/Library/Android/sdk/platform-tools:/Users/username/Library/Android/sdk/emulator:/Users/username/Library/Android/sdk/platform-tools" VSLANG="1033" "cc" "-Wl,--version-script=/var/folders/k5/6fyb698x6vq6v4c4km3hy2km0000gn/T/rustceufrwY/list" "-Wl,--no-undefined-version" "-m64" "/var/folders/k5/6fyb698x6vq6v4c4km3hy2km0000gn/T/rustceufrwY/symbols.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.00.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.01.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.02.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.03.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.04.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.05.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.06.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.07.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.08.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.09.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.10.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.11.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.12.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.13.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.14.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.my_first_tauri_v2_app_playground_lib.5638cf32edc6bd30-cgu.15.rcgu.o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/my_first_tauri_v2_app_playground_lib.2wfjc011hmnjvdcx.rcgu.o" "-Wl,--as-needed" "-L" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps" "-L" "/my-first-tauri-v2-app-playground/src-tauri/target/release/deps" "-L" "/opt/homebrew/Cellar/openssl@3/3.3.0/lib" "-L" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib" "-Wl,-Bstatic" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtauri_plugin_shell-2ab7c8bd7052143d.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libopen-9c9401fb40767dbc.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libpathdiff-b4c3bc0fc23fc681.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libis_wsl-21a2b9b939b48dcc.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libis_docker-671daf260ecf1245.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libschemars-b37f0929154aa8e1.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libdyn_clone-cfc2429e0866c39c.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libshared_child-a9a04bcddea45464.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libos_pipe-90bfaa81c01de28d.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libencoding_rs-19218f4c961a69b6.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtauri-cfefdf38100bbb67.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libheck-38dfd9031c6907ff.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libgetrandom-ed18f9aa2a642453.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libmime-a9e23617b087e1ab.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libanyhow-97db895d625bb546.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtauri_runtime_wry-f0e3e89c3dacff88.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libwry-6275070d1970ea8f.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libsha2-61d4cc4a340ba7ec.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libcpufeatures-ed19666f64efa5ef.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libdigest-c830f63922727d8f.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libblock_buffer-10bd9c69188f1883.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libcrypto_common-a91633416e97067e.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libgeneric_array-cf076cab8c1fc8a6.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtypenum-f1f15f2029bee6af.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libbase64-d9b7cb85332d383d.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtao-d4b0647722a980ea.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libndk_context-4f86289a76cc9fc5.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libndk-8265ecf54111abad.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libndk_sys-d01067a5bf8214ed.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libraw_window_handle-bd370a11a6f74fc7.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libnum_enum-36f157f35b6e5ede.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libcrossbeam_channel-89d7bc60482b8fe6.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libcrossbeam_utils-5c91732c62f0d997.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libinstant-049a4273b70a9e76.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libbitflags-9f290b03bff9f43b.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/liblazy_static-dbfd5685b45ebaf7.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libstate-315e34a607ae893b.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libfutures_util-4177da9b23f0f3aa.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libslab-f11ca30b8fbaa381.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libfutures_task-3eb2689f3c90fe88.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libpin_utils-acd1332d245e6960.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libfutures_core-7d9d334385c4cb3b.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtokio-2362d984c6e6c420.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libnum_cpus-32ac5c44166ed0f3.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libsocket2-2dbe04bb79827721.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libmio-55096c755ec714ef.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libpin_project_lite-c7572dd3625db405.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtauri_runtime-e218f47f7fdfd9f1.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libjni-3b5ba67bbcb64047.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libcesu8-eb12e4c494f896fd.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libcombine-1479c6a3f4d1c72e.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libjni_sys-5cc7583ffa0e02dd.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libdpi-7493dcce46ea31c9.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libhttp-dff3e46e485b7d81.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libbytes-7ce822bbc1a17004.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtauri_utils-52da92cfeb12e3b0.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libdunce-026780ccd59c6879.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libwalkdir-491f9f8fcbb23cf7.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libsame_file-225ed1b2182e75cf.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libinfer-77934acf19b48bea.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libcfb-d1f8a9c5a275ccdd.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libuuid-1e721cf2e0646c6c.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libfnv-080f2c610c2e0f32.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libbrotli-e76c07389b8dc799.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libbrotli_decompressor-e62001a4521a1b82.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/liballoc_stdlib-2e0c267fb08b7f48.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/liballoc_no_stdlib-995ea9b53e990060.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/liburlpattern-72bd14770facb5f5.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libunic_ucd_ident-c542b9fba97ef2a0.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libunic_ucd_version-8fea62c61363424a.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libunic_common-bd4bdf75e95170f3.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libunic_char_property-b6a352135e73afd1.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libunic_char_range-e9b25c0891703834.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libregex-8d3b1df273c7eb38.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libregex_automata-06297440bb0c4bdf.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libaho_corasick-ccabd4e1af9abf50.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libmemchr-afc13436cfb081c8.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libregex_syntax-a68240279b06a206.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libglob-15f782c7eb3fa784.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libkuchikiki-9a758490a5237b75.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libselectors-8411ed307d3f9ef6.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libthin_slice-872045504c8ee6cc.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libservo_arc-b732c6f10f0988a3.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libstable_deref_trait-0ac377aa8af0b31a.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libnodrop-ddd161a32a9bc3c1.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libfxhash-b160553b9da49774.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libbyteorder-bff183c5fcd87451.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libbitflags-9e21383b99f67f4e.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libcssparser-24c8bf1e17b97632.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libitoa-5a1e76a875498087.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libdtoa_short-80e622f572663ef1.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libdtoa-cbee5ff3c4cb4cb7.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libphf-2fad1400575e5fc2.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libphf_shared-acc89dbd66563d1c.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libindexmap-376411bf217b4233.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libhashbrown-ea4180fbbaaf1510.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libmatches-04e8dcdebcb41620.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libhtml5ever-656a83e065f778b9.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/liblog-767b0dde61c8b5bf.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libmarkup5ever-68285c5ce0da3ff5.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libstring_cache-8b1ce6f57ba3190a.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libprecomputed_hash-dece40fc22b2c880.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libparking_lot-0e4d8fc14cc534e8.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libparking_lot_core-a2f2e6e590508aa1.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/liblibc-6b2bf41d27c812c1.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libcfg_if-31df303ea513ff7b.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libsmallvec-10b341caf0900d3a.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/liblock_api-fad0ae51b1706696.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libscopeguard-e445a95ebb607a6e.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libonce_cell-57c1ff4565ce5a00.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libphf-0204ee15eb0107da.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libphf_shared-f77ded21251fe8b9.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtendril-26ba125147be9e4c.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libutf8-f550cc989851c1a8.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libfutf-4d1df72834f4fa1e.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libdebug_unreachable-808dc2264f4e3ed0.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libmac-400eaf38ec3c424c.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libjson_patch-00dc336bb81cf339.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtreediff-0b3ef365ee2958c2.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libserde_with-1c37c9df163ea013.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libphf-8960d54636cc298c.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libphf_shared-a18c0331cf710cd5.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libsiphasher-eef6c1cf5a5978da.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtoml-caf4bcd3862115b2.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtoml_edit-6a8eb8af9cae5be3.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libserde_spanned-a37217e186dbf9b8.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libindexmap-7d0d1b058cc842c8.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libequivalent-a08cf691a8de8c55.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libhashbrown-5e6c288ef85a4214.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libwinnow-ffcd118ca7691b3a.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtoml_datetime-4ed5db0b778d7590.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libthiserror-1665ac8164a18487.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libsemver-5bde4b6c34ab258f.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libserialize_to_javascript-cfbfbee234ac78bf.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libserde_json-ccdca71f747bc6ad.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libitoa-f4ebdcfb0e156984.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libryu-35cd4aff01aa03ea.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libraw_window_handle-cfea2b6e554bf0b5.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/liburl-e2895b8b2ebfcde8.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libidna-5aefae68dcbc0e1c.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libunicode_normalization-5c76f905ecd6069d.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtinyvec-5e5965c77811f3e7.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libtinyvec_macros-4e15c7b348c6f225.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libunicode_bidi-6c8895a9e2bcdfeb.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libform_urlencoded-6055f720941073e5.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libpercent_encoding-8892093a8db527ae.rlib" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libserde-9fd3f548a4b585c7.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libstd-8256987ef2733c35.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libpanic_unwind-76f98cb74575c4f1.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libobject-4b958ffb16eb3fe3.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libmemchr-a514efaafd0320b7.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libaddr2line-92f94a003c51c9d2.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libgimli-8609aee61a88466b.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/librustc_demangle-0fd891c684921033.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libstd_detect-cdc2da7056202781.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libhashbrown-3c42fa570767e5cc.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/librustc_std_workspace_alloc-fb32047e924d12b4.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libminiz_oxide-da901de91a4beb8f.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libadler-a127b6399ed929ba.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libunwind-89f4461af616034a.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libcfg_if-946e4044e0456daf.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/liblibc-2cc8da54791c97ba.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/liballoc-a27d9895be20e213.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/librustc_std_workspace_core-72d368bccad1a291.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libcore-91c877401538e2ad.rlib" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libcompiler_builtins-38754baa5b7a9eaa.rlib" "-Wl,-Bdynamic" "-landroid" "-ldl" "-llog" "-lunwind" "-ldl" "-lm" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/Users/username/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/x86_64-linux-android/lib" "-o" "/my-first-tauri-v2-app-playground/src-tauri/target/x86_64-linux-android/release/deps/libmy_first_tauri_v2_app_playground_lib.so" "-Wl,--gc-sections" "-shared" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs"
  = note: ld: unknown options: --version-script=/var/folders/k5/6fyb698x6vq6v4c4km3hy2km0000gn/T/rustceufrwY/list --no-undefined-version --as-needed -Bstatic -Bdynamic --eh-frame-hdr -z --gc-sections -z -z 
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `my-first-tauri-v2-app-playground` (lib) due to 1 previous error
    Error failed to build app: failed to build app
 ELIFECYCLE  Command failed with exit code 1.

@GOWxx
Copy link
Author

GOWxx commented Apr 26, 2024

% rustup -V
rustup 1.27.0 (bbb9276d2 2024-03-08)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.77.2 (25ef9e3d8 2024-04-09)`
% rustc -vV
rustc 1.77.2 (25ef9e3d8 2024-04-09)
binary: rustc
commit-hash: 25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04
commit-date: 2024-04-09
host: aarch64-apple-darwin
release: 1.77.2
LLVM version: 17.0.6
% cargo -vV
cargo 1.77.2 (e52e36006 2024-03-26)
release: 1.77.2
commit-hash: e52e360061cacbbeac79f7f1215a7a90b6f08442
commit-date: 2024-03-26
host: aarch64-apple-darwin
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.4.0 (sys:0.4.70+curl-8.5.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Mac OS 14.4.1 [64-bit]

Unclear if there is any issue with the OpenSSL here: OpenSSL 1.1.1w 11 Sep 2023. It seems that cargo did not comply with the specified environment variables. I will investigate further later.

% which cargo rustc rustup
/Users/username/.cargo/bin/cargo
/Users/username/.cargo/bin/rustc
/Users/username/.cargo/bin/rustup

@GOWxx
Copy link
Author

GOWxx commented Apr 26, 2024

Update:

Edit ~/.cargo/config

[target.x86_64-linux-android]
linker = "/Users/username/Library/Android/sdk/ndk/27.0.11718014/toolchains/llvm/prebuilt/darwin-x86_64/bin/x86_64-linux-android35-clang"

Run

% cd tauri-src
% cargo clean
% cargo  build --bins --features tauri/custom-protocol,tauri/native-tls --release --target x86_64-linux-android

cargo build succeeded
A part of the logs

   ...
   Compiling pkg-config v0.3.30
   Compiling regex v1.10.4
   Compiling openssl-sys v0.9.102
   Compiling powerfmt v0.2.0
   Compiling futures-core v0.3.30
   Compiling deranged v0.3.11
   Compiling socket2 v0.5.6
   Compiling mio v0.8.11
   Compiling num_cpus v1.16.0
   Compiling slab v0.4.9
   Compiling num-conv v0.1.0
   Compiling time-core v0.1.2
   Compiling time v0.3.36
   Compiling quick-xml v0.31.0
   Compiling serde_spanned v0.6.5
   Compiling toml_datetime v0.6.3
   Compiling bytes v1.6.0
   Compiling toml_edit v0.19.15
   Compiling toml_edit v0.20.2
   Compiling string_cache v0.8.7
   Compiling url v2.5.0
   Compiling treediff v4.0.3
   Compiling cargo-platform v0.1.8
   Compiling urlpattern v0.2.0
   Compiling swift-rs v1.0.6
   Compiling cargo_metadata v0.18.1
   Compiling json-patch v1.2.0
   Compiling serde_with v3.8.0
   Compiling http v1.1.0
   Compiling toml v0.8.2
   Compiling kuchikiki v0.8.2
   Compiling rustc_version v0.4.0
   Compiling embed-resource v2.4.2
   Compiling toml v0.7.8
   Compiling tokio v1.37.0
   Compiling dirs-sys-next v0.1.2
   Compiling bitflags v2.5.0
   Compiling simd-adler32 v0.3.7
   Compiling crc32fast v1.4.0
   Compiling line-wrap v0.2.0
   Compiling jni-sys v0.3.0
   Compiling plist v1.6.1
   Compiling tauri-winres v0.1.1
   Compiling dirs-next v2.0.0
   Compiling cargo_toml v0.17.2
   Compiling proc-macro-crate v1.3.1
   Compiling tauri-utils v2.0.0-beta.13
   Compiling futures-macro v0.3.30
   Compiling tracing-core v0.1.32
   Compiling crossbeam-utils v0.8.19
   Compiling heck v0.5.0
   Compiling openssl v0.10.64
   Compiling futures-task v0.3.30
   Compiling adler v1.0.2
   Compiling httparse v1.8.0
   Compiling foreign-types-shared v0.1.1
   Compiling pin-utils v0.1.0
   Compiling futures-util v0.3.30
   Compiling foreign-types v0.3.2
   Compiling miniz_oxide v0.7.2
   Compiling tracing v0.1.40
   Compiling num_enum_derive v0.5.11
   Compiling http-body v1.0.0
   Compiling combine v4.6.7
   Compiling tauri-build v2.0.0-beta.13
   Compiling pin-project-internal v1.1.5
   Compiling openssl-macros v0.1.1
   Compiling cesu8 v1.1.0
   Compiling try-lock v0.2.5
   Compiling heck v0.4.1
   Compiling native-tls v0.2.11
   Compiling pin-project v1.1.5
   Compiling want v0.3.1
   Compiling jni v0.21.1
   Compiling num_enum v0.5.11
   Compiling flate2 v1.0.29
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling ndk-sys v0.4.1+23.1.7779620
   Compiling fdeflate v0.3.4
   Compiling dpi v0.1.1
   Compiling futures-channel v0.3.30
   Compiling raw-window-handle v0.6.1
   Compiling tower-layer v0.3.2
   Compiling openssl-probe v0.1.5
   Compiling raw-window-handle v0.5.2
   Compiling tower-service v0.3.2
   Compiling base64 v0.22.0
   Compiling tower v0.4.13
   Compiling ndk v0.7.0
   Compiling hyper v1.3.1
   Compiling png v0.17.13
   Compiling digest v0.10.7
   Compiling tauri v2.0.0-beta.16
   Compiling crossbeam-channel v0.5.12
   Compiling tao-macros v0.1.2
   Compiling cpufeatures v0.2.12
   Compiling tauri-runtime v2.0.0-beta.13
   Compiling ndk-context v0.1.1
   Compiling wry v0.39.3
   Compiling sha2 v0.10.8
   Compiling ico v0.3.0
   Compiling hyper-util v0.1.3
   Compiling tokio-native-tls v0.3.1
   Compiling tauri-plugin v2.0.0-beta.13
   Compiling http-body-util v0.1.1
   Compiling instant v0.1.12
   Compiling rustls-pki-types v1.5.0
   Compiling lazy_static v1.4.0
   Compiling futures-sink v0.3.30
   Compiling tauri-runtime-wry v2.0.0-beta.13
   Compiling tauri-codegen v2.0.0-beta.13
   Compiling hyper-tls v0.6.0
   Compiling tauri-plugin-shell v2.0.0-beta.3
   Compiling tokio-util v0.7.10
   Compiling tao v0.27.1
   Compiling rustls-pemfile v2.1.2
   Compiling serde_urlencoded v0.7.1
   Compiling serialize-to-javascript-impl v0.1.1
   Compiling is-docker v0.2.0
   Compiling sync_wrapper v0.1.2
   Compiling mime v0.3.17
   Compiling ipnet v2.9.0
   Compiling reqwest v0.12.4
   Compiling is-wsl v0.4.0
   Compiling serialize-to-javascript v0.1.1
   Compiling tauri-macros v2.0.0-beta.13
   Compiling serde_repr v0.1.19
   Compiling pathdiff v0.2.1
   Compiling state v0.6.0
   Compiling open v5.1.2
   Compiling my-first-tauri-v2-app-playground v0.0.0 (/Users/gowxx/code/unGit/my-first-tauri-v2-app-playground/src-tauri)
   Compiling shared_child v1.0.0
   Compiling os_pipe v1.1.5
   Compiling encoding_rs v0.8.34
    Finished release [optimized] target(s) in 45.34s

Try running the command pnpm tauri build

 % pnpm tauri build --target x86_64-linux-android

> my-first-tauri-v2-app-playground@0.0.0 tauri /my-first-tauri-v2-app-playground
> tauri "build" "--target" "x86_64-linux-android"

**Running beforeBuildCommand `pnpm build`**

> my-first-tauri-v2-app-playground@0.0.0 build /my-first-tauri-v2-app-playground
> tsc && vite build

vite v5.2.10 building for production...
✓ 35 modules transformed.
dist/index.html                   0.47 kB │ gzip:  0.30 kB
dist/assets/react-CHdo91hT.svg    4.13 kB │ gzip:  2.05 kB
dist/assets/index-Dfkbh-rD.css    1.37 kB │ gzip:  0.65 kB
dist/assets/index-COgqIs9e.js   143.70 kB │ gzip: 46.21 kB
✓ built in 382ms
   Compiling my-first-tauri-v2-app-playground v0.0.0 (/my-first-tauri-v2-app-playground/src-tauri)
    Finished release [optimized] target(s) in 7.08s
    Error failed to bundle project: `Native android bundles not yet supported.`
 ELIFECYCLE  Command failed with exit code 1.

@GOWxx
Copy link
Author

GOWxx commented Apr 26, 2024

Update:

Encountered a prompt:

Error Project directory /my-first-tauri-v2-app-playground/src-tauri/gen/android/app/src/main/java/com/username/my_first_tauri_v2_app_playground does not exist. Did you update the package name in `Cargo.toml` or the bundle identifier in `tauri.conf.json > identifier`? Save your changes, delete the `gen/android` folder and run `tauri android init` to recreate the Android project.
 ELIFECYCLE  Command failed with exit code 1.

Edit Cargo.toml and tauri.conf.json > identifier

delete the gen/android folder and run tauri android init

Run command

Run command `pnpm tauri android init

% pnpm tauri android init

> my-first-tauri-v2-app-playground@0.0.0 tauri /my-first-tauri-v2-app-playground
> tauri "android" "init"

Generating Android Studio project...
    Info "my-first-tauri-v2-app-playground/src-tauri" relative to "/my-first-tauri-v2-app-playground/src-tauri/gen/android/my_first_tauri_v2_app_playground" is "../../../"
victory: Project generated successfully!
    Make cool apps! 🌻 🐕 **🎉**

Run Command pnpm tauri android dev

% pnpm tauri android dev

> my-first-tauri-v2-app-playground@0.0.0 tauri /my-first-tauri-v2-app-playground
> tauri "android" "dev"

    Info Detected connected device: Pixel_3a_API_33_arm64-v8a (sdk_gphone64_arm64) with target "aarch64-linux-android"
    Info Using 192.168.50.85 to access the development server.
    Running BeforeDevCommand (`pnpm dev`)

> my-first-tauri-v2-app-playground@0.0.0 dev /my-first-tauri-v2-app-playground
> vite


  VITE v5.2.10  ready in 156 ms

  ➜  Local:   http://localhost:1420/
  ➜  Network: http://192.168.50.85:1420/
    Info detected host target triple "aarch64-apple-darwin"
   Compiling proc-macro2 v1.0.81
   Compiling unicode-ident v1.0.12
   Compiling libc v0.2.153
   Compiling cfg-if v1.0.0
   Compiling serde v1.0.198
   Compiling syn v1.0.109
   Compiling siphasher v0.3.11
   Compiling ppv-lite86 v0.2.17
   Compiling autocfg v1.2.0
   Compiling getrandom v0.1.16
   Compiling phf_shared v0.10.0
   Compiling phf_shared v0.8.0
   Compiling parking_lot_core v0.9.10
   Compiling hashbrown v0.14.3
   Compiling equivalent v1.0.1
   Compiling proc-macro-hack v0.5.20+deprecated
   Compiling lock_api v0.4.12
   Compiling indexmap v2.2.6
   Compiling winnow v0.5.40
   Compiling thiserror v1.0.59
   Compiling once_cell v1.19.0
   Compiling fnv v1.0.7
   Compiling convert_case v0.4.0
   Compiling itoa v1.0.11
   Compiling serde_json v1.0.116
   Compiling ident_case v1.0.1
   Compiling strsim v0.10.0
   Compiling memchr v2.7.2
   Compiling smallvec v1.13.2
   Compiling ryu v1.0.17
   Compiling phf_shared v0.11.2
   Compiling typenum v1.17.0
   Compiling tinyvec_macros v0.1.1
   Compiling new_debug_unreachable v1.0.6
   Compiling getrandom v0.2.14
   Compiling semver v1.0.22
   Compiling version_check v0.9.4
   Compiling rand_core v0.6.4
   Compiling rand_core v0.5.1
   Compiling byteorder v1.5.0
   Compiling rand_chacha v0.3.1
   Compiling rand_chacha v0.2.2
   Compiling rand_pcg v0.2.1
   Compiling scopeguard v1.2.0
   Compiling rand v0.8.5
   Compiling rand v0.7.3
   Compiling generic-array v0.14.7
   Compiling tinyvec v1.6.0
   Compiling mac v0.1.1
   Compiling precomputed-hash v0.1.1
   Compiling futf v0.1.5
   Compiling indexmap v1.9.3
   Compiling percent-encoding v2.3.1
   Compiling phf_generator v0.10.0
   Compiling phf_codegen v0.10.0
   Compiling phf_generator v0.8.0
   Compiling phf_generator v0.11.2
   Compiling phf_codegen v0.8.0
   Compiling log v0.4.21
   Compiling unicode-bidi v0.3.15
   Compiling dtoa v1.0.9
   Compiling utf-8 v0.7.6
   Compiling bitflags v1.3.2
   Compiling quote v1.0.36
   Compiling unicode-normalization v0.1.23
   Compiling selectors v0.22.0
   Compiling syn v2.0.60
   Compiling string_cache_codegen v0.5.2
   Compiling idna v0.5.0
   Compiling tendril v0.4.3
   Compiling dtoa-short v0.3.4
   Compiling form_urlencoded v1.2.1
   Compiling aho-corasick v1.1.3
   Compiling phf v0.10.1
   Compiling alloc-no-stdlib v2.0.4
   Compiling parking_lot v0.12.2
   Compiling markup5ever v0.11.0
   Compiling nodrop v0.1.14
   Compiling unic-common v0.9.0
   Compiling matches v0.1.10
   Compiling camino v1.1.6
   Compiling itoa v0.4.8
   Compiling unic-char-range v0.9.0
   Compiling hashbrown v0.12.3
   Compiling regex-syntax v0.8.3
   Compiling stable_deref_trait v1.2.0
   Compiling servo_arc v0.1.1
   Compiling unic-char-property v0.9.0
   Compiling unic-ucd-version v0.9.0
   Compiling alloc-stdlib v0.2.2
   Compiling fxhash v0.2.1
   Compiling uuid v1.8.0
   Compiling base64 v0.21.7
   Compiling schemars v0.8.16
   Compiling thin-slice v0.1.1
   Compiling cfb v0.7.3
   Compiling brotli-decompressor v2.5.1
   Compiling unic-ucd-ident v0.9.0
   Compiling same-file v1.0.6
   Compiling anyhow v1.0.82
   Compiling darling_core v0.20.8
   Compiling regex-automata v0.4.6
   Compiling serde_derive_internals v0.26.0
   Compiling dyn-clone v1.0.17
   Compiling brotli v3.5.0
   Compiling infer v0.15.0
   Compiling walkdir v2.5.0
   Compiling glob v0.3.1
   Compiling dunce v1.0.4
   Compiling powerfmt v0.2.0
   Compiling pin-project-lite v0.2.14
   Compiling deranged v0.3.11
   Compiling regex v1.10.4
   Compiling futures-core v0.3.30
   Compiling cc v1.0.95
   Compiling num-conv v0.1.0
   Compiling time-core v0.1.2
   Compiling time v0.3.36
   Compiling serde_derive v1.0.198
   Compiling thiserror-impl v1.0.59
   Compiling cssparser-macros v0.6.1
   Compiling darling_macro v0.20.8
   Compiling cssparser v0.27.2
   Compiling phf_macros v0.8.0
   Compiling derive_more v0.99.17
   Compiling html5ever v0.26.0
   Compiling darling v0.20.8
   Compiling phf_macros v0.11.2
   Compiling serde_with_macros v3.8.0
   Compiling ctor v0.2.8
   Compiling schemars_derive v0.8.16
   Compiling phf v0.8.0
   Compiling phf v0.11.2
   Compiling dirs-sys-next v0.1.2
   Compiling quick-xml v0.31.0
   Compiling slab v0.4.9
   Compiling line-wrap v0.2.0
   Compiling simd-adler32 v0.3.7
   Compiling crc32fast v1.4.0
   Compiling jni-sys v0.3.0
   Compiling dirs-next v2.0.0
   Compiling num_cpus v1.16.0
   Compiling socket2 v0.5.6
   Compiling mio v0.8.11
   Compiling adler v1.0.2
   Compiling heck v0.5.0
   Compiling crossbeam-utils v0.8.19
   Compiling miniz_oxide v0.7.2
   Compiling futures-macro v0.3.30
   Compiling tracing-core v0.1.32
   Compiling cesu8 v1.1.0
   Compiling httparse v1.8.0
   Compiling heck v0.4.1
   Compiling futures-task v0.3.30
   Compiling pin-utils v0.1.0
   Compiling futures-util v0.3.30
   Compiling tracing v0.1.40
   Compiling flate2 v1.0.29
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling toml_datetime v0.6.3
   Compiling serde_spanned v0.6.5
   Compiling bytes v1.6.0
   Compiling toml_edit v0.20.2
   Compiling toml_edit v0.19.15
   Compiling string_cache v0.8.7
   Compiling url v2.5.0
   Compiling cargo-platform v0.1.8
   Compiling treediff v4.0.3
   Compiling cargo_metadata v0.18.1
   Compiling swift-rs v1.0.6
   Compiling json-patch v1.2.0
   Compiling urlpattern v0.2.0
   Compiling serde_with v3.8.0
   Compiling toml v0.8.2
   Compiling kuchikiki v0.8.2
   Compiling http v1.1.0
   Compiling rustc_version v0.4.0
   Compiling embed-resource v2.4.2
   Compiling toml v0.7.8
   Compiling cargo_toml v0.17.2
   Compiling proc-macro-crate v1.3.1
   Compiling tauri-utils v2.0.0-beta.13
   Compiling tauri-winres v0.1.1
   Compiling plist v1.6.1
   Compiling tokio v1.37.0
   Compiling combine v4.6.7
   Compiling num_enum_derive v0.5.11
   Compiling http-body v1.0.0
   Compiling dpi v0.1.1
   Compiling ndk-sys v0.4.1+23.1.7779620
   Compiling fdeflate v0.3.4
   Compiling pin-project-internal v1.1.5
   Compiling raw-window-handle v0.5.2
   Compiling raw-window-handle v0.6.1
   Compiling num_enum v0.5.11
   Compiling try-lock v0.2.5
   Compiling want v0.3.1
   Compiling png v0.17.13
   Compiling ndk v0.7.0
   Compiling pin-project v1.1.5
   Compiling digest v0.10.7
   Compiling crossbeam-channel v0.5.12
   Compiling tao-macros v0.1.2
   Compiling futures-channel v0.3.30
   Compiling cpufeatures v0.2.12
   Compiling tauri-build v2.0.0-beta.13
   Compiling tower-service v0.3.2
   Compiling base64 v0.22.0
   Compiling tower-layer v0.3.2
   Compiling ndk-context v0.1.1
   Compiling wry v0.39.3
   Compiling tauri-runtime v2.0.0-beta.13
   Compiling jni v0.21.1
   Compiling tower v0.4.13
   Compiling hyper v1.3.1
   Compiling sha2 v0.10.8
   Compiling tauri-plugin v2.0.0-beta.13
   Compiling ico v0.3.0
   Compiling instant v0.1.12
   Compiling lazy_static v1.4.0
   Compiling futures-sink v0.3.30
   Compiling tauri-runtime-wry v2.0.0-beta.13
   Compiling bitflags v2.5.0
   Compiling tokio-util v0.7.10
   Compiling tauri-codegen v2.0.0-beta.13
   Compiling hyper-util v0.1.3
   Compiling http-body-util v0.1.1
   Compiling serde_urlencoded v0.7.1
   Compiling serialize-to-javascript-impl v0.1.1
   Compiling is-docker v0.2.0
   Compiling ipnet v2.9.0
   Compiling tao v0.27.1
   Compiling sync_wrapper v0.1.2
   Compiling mime v0.3.17
   Compiling reqwest v0.12.4
   Compiling is-wsl v0.4.0
   Compiling serialize-to-javascript v0.1.1
   Compiling serde_repr v0.1.19
   Compiling pathdiff v0.2.1
   Compiling state v0.6.0
   Compiling open v5.1.2
   Compiling shared_child v1.0.0
   Compiling os_pipe v1.1.5
   Compiling encoding_rs v0.8.34
   Compiling tauri v2.0.0-beta.16
   Compiling tauri-plugin-shell v2.0.0-beta.3
   Compiling tauri-macros v2.0.0-beta.13
   Compiling my-first-tauri-v2-app-playground v0.0.1 (/my-first-tauri-v2-app-playground/src-tauri)
    Finished dev [unoptimized + debuginfo] target(s) in 33.95s
    Info symlinking lib "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" in jniLibs dir "/my-first-tauri-v2-app-playground/src-tauri/gen/android/app/src/main/jniLibs/arm64-v8a"
    Info "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" requires shared lib "libandroid.so"
    Info "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" requires shared lib "libdl.so"
    Info "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" requires shared lib "liblog.so"
    Info "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" requires shared lib "libm.so"
    Info "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" requires shared lib "libc.so"
    Info symlink at "/my-first-tauri-v2-app-playground/src-tauri/gen/android/app/src/main/jniLibs/arm64-v8a/libmy_first_tauri_v2_app_playground_lib.so" points to "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so"
Downloading https://services.gradle.org/distributions/gradle-8.0-bin.zip
...........10%............20%............30%............40%............50%............60%...........70%............80%............90%............100%

> my-first-tauri-v2-app-playground@0.0.0 tauri /my-first-tauri-v2-app-playground
> tauri "android" "android-studio-script" "--target" "aarch64"

<=======------> 58% EXECUTING [1m 17s]
    Updating crates.io indexG [1m 19s]kage
 Downloading crates ...
  Downloaded hyper-rustls v0.26.0 21s]
  Downloaded untrusted v0.9.0estForPackage
w: /Users/username/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-2.0.0-beta.16/mobile/android/src/main/java/app/tauri/plugin/PluginMethodData.kt: (11, 23): Parameter 'methodDecorator' is never used
  Downloaded subtle v2.5.0ING [1m 22s]
  Downloaded zeroize v1.7.0NG [1m 22s]
  Downloaded tokio-rustls v0.25.0 27s]
  Downloaded rustls-webpki v0.102.37s]
  Downloaded webpki-roots v0.26.1 58s]
  Downloaded rustls v0.22.4NG [1m 58s]
  Downloaded ring v0.17.8TING [2m 2s]
   Compiling ring v0.17.8TING [2m 2s]
   Compiling rustls-pki-types v1.5.0ackage
   Compiling spin v0.9.8
   Compiling untrusted v0.9.0
   Compiling rustls v0.22.4
   Compiling zeroize v1.7.0
   Compiling subtle v2.5.0
   Compiling tauri v2.0.0-beta.16
   Compiling wry v0.39.3ug
   Compiling rustls-pemfile v2.1.23s]
   Compiling webpki-roots v0.26.1orPackage
   Compiling tauri-runtime-wry v2.0.0-beta.13
   Compiling tauri-plugin-shell v2.0.0-beta.3
   Compiling my-first-tauri-v2-app-playground v0.0.1 (/my-first-tauri-v2-app-playground/src-tauri)
   Compiling rustls-webpki v0.102.3s]ckage
   Compiling tokio-rustls v0.25.0 8s]
   Compiling hyper-rustls v0.26.0 8s]
   Compiling reqwest v0.12.4G [2m 8s]
    Finished dev [unoptimized + debuginfo] target(s) in 55.96s
    Info symlinking lib "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" in jniLibs dir "/my-first-tauri-v2-app-playground/src-tauri/gen/android/app/src/main/jniLibs/arm64-v8a"
    Info "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" requires shared lib "libandroid.so"
    Info "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" requires shared lib "libdl.so"
    Info "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" requires shared lib "liblog.so"
    Info "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" requires shared lib "libm.so"
    Info "/my-first-tauri-v2-app-playground/src-tauri/target/aarch64-linux-android/debug/libmy_first_tauri_v2_app_playground_lib.so" requires shared lib "libc.so"

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.0/userguide/command_line_interface.html#sec:command_line_warnings
Performing Streamed Install
Success
Starting: Intent { cmp=com.username.my_first_tauri_v2_app_playground/.MainActivity }

Successfully running the app in the emulator

image

Run pnpm tauri build --target x86_64-linux-android failed

% pnpm tauri build --target x86_64-linux-android

> my-first-tauri-v2-app-playground@0.0.0 tauri /my-first-tauri-v2-app-playground
> tauri "build" "--target" "x86_64-linux-android"

    Running beforeBuildCommand `pnpm build`

> my-first-tauri-v2-app-playground@0.0.0 build /my-first-tauri-v2-app-playground
> tsc && vite build

vite v5.2.10 building for production...
✓ 35 modules transformed.
dist/index.html                   0.47 kB │ gzip:  0.30 kB
dist/assets/react-CHdo91hT.svg    4.13 kB │ gzip:  2.05 kB
dist/assets/index-Dfkbh-rD.css    1.37 kB │ gzip:  0.65 kB
dist/assets/index-COgqIs9e.js   143.70 kB │ gzip: 46.21 kB
✓ built in 375ms
   Compiling my-first-tauri-v2-app-playground v0.0.1 (/my-first-tauri-v2-app-playground/src-tauri)
    Finished release [optimized] target(s) in 7.53s
    Error failed to bundle project: `Native android bundles not yet supported.`
 ELIFECYCLE  Command failed with exit code 1.

@GOWxx GOWxx changed the title [bug] Tauri 2.0 cannot build target android [bug][v2][macos] Tauri 2.0 cannot build target android Apr 26, 2024
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

1 participant