DarthCucumber
DarthCucumber

Reputation: 71

Failed to find tool `aarch64-linux-android-clang`, is it installed?

I'm trying to generate a .so file of the a rust program using:

cargo build --release --target=aarch64-linux-android

here is the cargo.toml file:

[package]
name = "bevy-breakout"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["cdylib"]

[workspace]
resolver = "2" # Important! wgpu/Bevy needs this!

[profile.dev]
opt-level = 1

[profile.dev.package."*"]
opt-level = 3

[dependencies]
bevy = "0.13.1"
bevy_rapier2d = { version = "*", features = [
    "enhanced-determinism",
    "serde-serialize",
    "debug-render-2d",
] }
rand = "*"

however it throws following error:

Caused by:
  process didn't exit successfully: `/home/cp69/Projects/my-game/target/release/build/blake3-ff5ddfb3cb07c2b8/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
  cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
  cargo:rustc-cfg=blake3_neon
  TARGET = Some("aarch64-linux-android")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_aarch64-linux-android
  CC_aarch64-linux-android = None
  cargo:rerun-if-env-changed=CC_aarch64_linux_android
  CC_aarch64_linux_android = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-linux-android
  CFLAGS_aarch64-linux-android = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_linux_android
  CFLAGS_aarch64_linux_android = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT

  --- stderr


  error occurred: Failed to find tool. Is `aarch64-linux-android-clang` installed?

All the Android SDK and NDK path is set but still, it throws this error: aarch64-linux-android-clang is not there but something similar is there aarch64-linux-android29-clang not sure which path to set.

where am I going wrong?

Upvotes: 1

Views: 1265

Answers (1)

Tim Baas
Tim Baas

Reputation: 6185

Just had the same problem and fixed it by adding the following Android NDK LLVM bin to the Path environment variable:

C:\android\android-ndk-r27c\toolchains\llvm\prebuilt\windows-x86_64\bin

I downloaded the NDK here and unpacked it in C:\android\android-ndk-r27c.

Upvotes: 1

Related Questions