willir / cargo-ndk-android-gradle

Cargo NDK for Android projects
Apache License 2.0
55 stars 7 forks source link

cargo ndk error libsodium-sys #20

Open changcw83 opened 1 year ago

changcw83 commented 1 year ago

not sure if this is the place to ask. Am building rustdesk android app. ran into this problem when running the command cargo ndk --platform 21 --target aarch64-linux-android build --release --features flutter here is the last section of the error error: failed to run custom build command for libsodium-sys v0.2.7 Caused by: process didn't exit successfully: /Users/MBP15/projects/rustdesk/target/release/build/libsodium-sys-2cc6cbbf5c519475/build-script-build (exit status: 101) --- stdout cargo:rerun-if-env-changed=SODIUM_LIB_DIR cargo:rerun-if-env-changed=SODIUM_SHARED cargo:rerun-if-env-changed=SODIUM_USE_PKG_CONFIG cargo:rerun-if-env-changed=SODIUM_DISABLE_PIE OPT_LEVEL = Some("3") TARGET = Some("aarch64-linux-android") HOST = Some("x86_64-apple-darwin") cargo:rerun-if-env-changed=CC_aarch64-linux-android CC_aarch64-linux-android = Some("/Users/MBP15/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang") 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=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None DEBUG = Some("false") checking build system type... x86_64-apple-darwin21.6.0 checking host system type... aarch64-unknown-linux-android checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for aarch64-linux-android-strip... no checking for strip... strip checking for a thread-safe mkdir -p... build-aux/install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether UID '501' is supported by ustar format... yes checking whether GID '20' is supported by ustar format... yes checking how to create a ustar tar archive... gnutar checking whether make supports nested variables... (cached) yes checking whether to enable maintainer-specific portions of Makefiles... no checking whether make supports the include directive... yes (GNU style) checking for aarch64-linux-android-gcc... /Users/MBP15/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang checking whether the C compiler works... no

--- stderr configure: error: in /Users/MBP15/projects/rustdesk/target/aarch64-linux-android/release/build/libsodium-sys-bc031ec13d20478a/out/source/libsodium': configure: error: C compiler cannot create executables Seeconfig.log' for more details thread 'main' panicked at ' Failed to configure libsodium using cd "/Users/MBP15/projects/rustdesk/target/aarch64-linux-android/release/build/libsodium-sys-bc031ec13d20478a/out/source/libsodium" && CC="/Users/MBP15/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang" CFLAGS="-O3 -DANDROID -ffunction-sections -fdata-sections -fPIC --target=aarch64-linux-android -Wall -Wextra" "/Users/MBP15/projects/rustdesk/target/aarch64-linux-android/release/build/libsodium-sys-bc031ec13d20478a/out/source/libsodium/configure" "--prefix=/Users/MBP15/projects/rustdesk/target/aarch64-linux-android/release/build/libsodium-sys-bc031ec13d20478a/out/installed" "--libdir=/Users/MBP15/projects/rustdesk/target/aarch64-linux-android/release/build/libsodium-sys-bc031ec13d20478a/out/installed/lib" "--host=aarch64-linux-android" "--enable-shared=no" CFLAGS=-O3 -DANDROID -ffunction-sections -fdata-sections -fPIC --target=aarch64-linux-android -Wall -Wextra CC=/Users/MBP15/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang


Possible missing dependencies. See https://github.com/sodiumoxide/sodiumoxide#cross-compiling


', /Users/MBP15/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libsodium-sys-0.2.7/build.rs:257:9 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... [2023-06-29T03:34:26Z INFO cargo_ndk::cli] If the build failed due to a missing target, you can run this command: [2023-06-29T03:34:26Z INFO cargo_ndk::cli] [2023-06-29T03:34:26Z INFO cargo_ndk::cli] rustup target install aarch64-linux-android `