Caused by:
process didn't exit successfully: /home/adrian/code/leaf/target/release/build/leaf-2b83f3edfbf0264d/build-script-build (exit status: 101)
--- stdout
cargo:rerun-if-changed=src/mobile/wrapper.h
cargo:rerun-if-env-changed=TARGET
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-linux-android
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_linux_android
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
--- stderr
src/mobile/wrapper.h:5:14: fatal error: 'android/log.h' file not found
thread 'main' panicked at leaf/build.rs:37:10:
Unable to generate bindings: ClangDiagnostic("src/mobile/wrapper.h:5:14: fatal error: 'android/log.h' file not found\n")
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...```
### my command is as follows:
```export ANDROID_NDK=/home/adrian/code/leaf/android-ndk-r26b
export CC=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android34-clang
export AR=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
cargo build -p leaf-ffi --target x86_64-linux-android --release```
I just solved this issue on my project. You encountered this because it involves in rust-bindgen
which needs extra configuration when cross-compiling (https://docs.rs/bindgen/latest/bindgen/struct.Builder.html#clang-arguments).
Basically, ensure $ANDROID_NDK
env var is set correctly and set BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/path/to/your/ndk/sysroot"