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

hwcodec build error #14304

Closed
wangjunkai2022 opened this issue Jul 26, 2024 · 3 comments
Closed

hwcodec build error #14304

wangjunkai2022 opened this issue Jul 26, 2024 · 3 comments
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@wangjunkai2022
Copy link

wangjunkai2022 commented Jul 26, 2024

Problem

Compiling the Android version under Ubuntu reports an error: failed to run custom build command for `hwcodec v0.5.1
run ndk_arm64.sh error

I have made:

vcpkg/vcpkg install libvpx:arm64-android libyuv:arm64-android opus:arm64-android aom:arm64-android
cmake --version:
cmake version 3.29.2

The following is the error content:

error: failed to run custom build command for `hwcodec v0.5.1 (https://github.com/21pages/hwcodec#74e8288f)`

Caused by:
  process didn't exit successfully: `/home/ubuntu/rustdesk/target/release/build/hwcodec-b460c662c9e9eb6d/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=src
  cargo:rerun-if-changed=deps
  cargo:rerun-if-changed=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals
  cargo:rerun-if-changed=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp
  cargo:info=arm64-android
  cargo:rustc-link-search=native=/home/ubuntu/vcpkg/installed/arm64-android/lib
  cargo:rustc-link-lib=static=avcodec
  cargo:rustc-link-lib=static=avutil
  cargo:rustc-link-lib=static=avformat
  cargo:include=/home/ubuntu/vcpkg/installed/arm64-android/include
  cargo:rustc-link-lib=z
  cargo:rustc-link-lib=m
  cargo:rustc-link-lib=android
  cargo:rustc-link-lib=atomic
  OUT_DIR = Some(/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out)
  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 = Some(/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang)
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  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 = Some(--target=aarch64-linux-android21)
  cargo:warning=In file included from /home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux/linux.cpp:2:
  cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux/../../log.h:5:10: fatal error: 'libavutil/attributes.h' file not found
  cargo:warning=#include <libavutil/attributes.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/842c9e1a098b6d5e-linux.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux/linux.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=In file included from /home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/log.cpp:2:
  cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/log.h:5:10: fatal error: 'libavutil/attributes.h' file not found
  cargo:warning=#include <libavutil/attributes.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/e0b6db6686adfcc7-log.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/log.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/util.cpp:2:10: fatal error: 'libavutil/opt.h' file not found
  cargo:warning=#include <libavutil/opt.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/e0b6db6686adfcc7-util.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/util.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp:4:10: fatal error: 'libavcodec/avcodec.h' file not found
  cargo:warning=#include <libavcodec/avcodec.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/2cdb15a14ca8bd4d-ffmpeg_ram_encode.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_decode.cpp:5:10: fatal error: 'libavcodec/avcodec.h' file not found
  cargo:warning=#include <libavcodec/avcodec.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/2cdb15a14ca8bd4d-ffmpeg_ram_decode.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_decode.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/mux/mux.cpp:4:10: fatal error: 'libavcodec/avcodec.h' file not found
  cargo:warning=#include <libavcodec/avcodec.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/83634e825ea98caf-mux.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/mux/mux.cpp" with args clang did not execute successfully (status code exit status: 1).

  --- stderr


  error occurred: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/83634e825ea98caf-mux.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/mux/mux.cpp" with args clang did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
note: If the build failed due to a missing target, you can run this command:
note: 
note:     rustup target install aarch64-linux-android

Steps

No response

Possible Solution(s)

No response

Notes

I tried to install ffmpeg and libavcodec-dev using apt, but the compilation still failed.

Version

cargo 1.80.0 (376290515 2024-07-16)
release: 1.80.0
commit-hash: 37629051518c3df9ac2c1744589362a02ecafa99
commit-date: 2024-07-16
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Ubuntu 22.4.0 (jammy) [64-bit]


flutter --version
Flutter 3.22.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b0850beeb2 (9 days ago) • 2024-07-16 21:43:41 -0700
Engine • revision 235db911ba
Tools • Dart 3.4.4 • DevTools 2.34.3

android-ndk-r23c
@wangjunkai2022 wangjunkai2022 added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Jul 26, 2024
@epage
Copy link
Contributor

epage commented Jul 26, 2024

This looks to be a problem a specific package. I'd recommend either reaching out to the author for help in figuring out the build requirements or asking for help on the user forums at https://users.rust-lang.org/

If, through that investigation, you all find a way we could smooth this out for Cargo users, we'd love to hear about it! In the mean time, I'm going to go ahead and close this.

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2024
@Xiaolangs
Copy link

Problem

Compiling the Android version under Ubuntu reports an error: failed to run custom build command for `hwcodec v0.5.1 run ndk_arm64.sh error

I have made:

vcpkg/vcpkg install libvpx:arm64-android libyuv:arm64-android opus:arm64-android aom:arm64-android
cmake --version:
cmake version 3.29.2

The following is the error content:

error: failed to run custom build command for `hwcodec v0.5.1 (https://github.com/21pages/hwcodec#74e8288f)`

Caused by:
  process didn't exit successfully: `/home/ubuntu/rustdesk/target/release/build/hwcodec-b460c662c9e9eb6d/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=src
  cargo:rerun-if-changed=deps
  cargo:rerun-if-changed=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals
  cargo:rerun-if-changed=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp
  cargo:info=arm64-android
  cargo:rustc-link-search=native=/home/ubuntu/vcpkg/installed/arm64-android/lib
  cargo:rustc-link-lib=static=avcodec
  cargo:rustc-link-lib=static=avutil
  cargo:rustc-link-lib=static=avformat
  cargo:include=/home/ubuntu/vcpkg/installed/arm64-android/include
  cargo:rustc-link-lib=z
  cargo:rustc-link-lib=m
  cargo:rustc-link-lib=android
  cargo:rustc-link-lib=atomic
  OUT_DIR = Some(/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out)
  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 = Some(/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang)
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  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 = Some(--target=aarch64-linux-android21)
  cargo:warning=In file included from /home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux/linux.cpp:2:
  cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux/../../log.h:5:10: fatal error: 'libavutil/attributes.h' file not found
  cargo:warning=#include <libavutil/attributes.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/842c9e1a098b6d5e-linux.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux/linux.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=In file included from /home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/log.cpp:2:
  cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/log.h:5:10: fatal error: 'libavutil/attributes.h' file not found
  cargo:warning=#include <libavutil/attributes.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/e0b6db6686adfcc7-log.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/log.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/util.cpp:2:10: fatal error: 'libavutil/opt.h' file not found
  cargo:warning=#include <libavutil/opt.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/e0b6db6686adfcc7-util.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/util.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp:4:10: fatal error: 'libavcodec/avcodec.h' file not found
  cargo:warning=#include <libavcodec/avcodec.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/2cdb15a14ca8bd4d-ffmpeg_ram_encode.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_decode.cpp:5:10: fatal error: 'libavcodec/avcodec.h' file not found
  cargo:warning=#include <libavcodec/avcodec.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/2cdb15a14ca8bd4d-ffmpeg_ram_decode.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_decode.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/mux/mux.cpp:4:10: fatal error: 'libavcodec/avcodec.h' file not found
  cargo:warning=#include <libavcodec/avcodec.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/83634e825ea98caf-mux.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/mux/mux.cpp" with args clang did not execute successfully (status code exit status: 1).

  --- stderr


  error occurred: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/83634e825ea98caf-mux.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/mux/mux.cpp" with args clang did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
note: If the build failed due to a missing target, you can run this command:
note: 
note:     rustup target install aarch64-linux-android

Steps

No response

Possible Solution(s)

No response

Notes

I tried to install ffmpeg and libavcodec-dev using apt, but the compilation still failed.

Version

cargo 1.80.0 (376290515 2024-07-16)
release: 1.80.0
commit-hash: 37629051518c3df9ac2c1744589362a02ecafa99
commit-date: 2024-07-16
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Ubuntu 22.4.0 (jammy) [64-bit]


flutter --version
Flutter 3.22.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b0850beeb2 (9 days ago) • 2024-07-16 21:43:41 -0700
Engine • revision 235db911ba
Tools • Dart 3.4.4 • DevTools 2.34.3

android-ndk-r23c

解决了吗 大哥

@wangjunkai2022
Copy link
Author

Problem

Compiling the Android version under Ubuntu reports an error: failed to run custom build command for `hwcodec v0.5.1 run ndk_arm64.sh error
I have made:

vcpkg/vcpkg install libvpx:arm64-android libyuv:arm64-android opus:arm64-android aom:arm64-android
cmake --version:
cmake version 3.29.2

The following is the error content:

error: failed to run custom build command for `hwcodec v0.5.1 (https://github.com/21pages/hwcodec#74e8288f)`

Caused by:
  process didn't exit successfully: `/home/ubuntu/rustdesk/target/release/build/hwcodec-b460c662c9e9eb6d/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=src
  cargo:rerun-if-changed=deps
  cargo:rerun-if-changed=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals
  cargo:rerun-if-changed=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp
  cargo:info=arm64-android
  cargo:rustc-link-search=native=/home/ubuntu/vcpkg/installed/arm64-android/lib
  cargo:rustc-link-lib=static=avcodec
  cargo:rustc-link-lib=static=avutil
  cargo:rustc-link-lib=static=avformat
  cargo:include=/home/ubuntu/vcpkg/installed/arm64-android/include
  cargo:rustc-link-lib=z
  cargo:rustc-link-lib=m
  cargo:rustc-link-lib=android
  cargo:rustc-link-lib=atomic
  OUT_DIR = Some(/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out)
  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 = Some(/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang)
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  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 = Some(--target=aarch64-linux-android21)
  cargo:warning=In file included from /home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux/linux.cpp:2:
  cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux/../../log.h:5:10: fatal error: 'libavutil/attributes.h' file not found
  cargo:warning=#include <libavutil/attributes.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/842c9e1a098b6d5e-linux.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux/linux.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=In file included from /home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/log.cpp:2:
  cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/log.h:5:10: fatal error: 'libavutil/attributes.h' file not found
  cargo:warning=#include <libavutil/attributes.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/e0b6db6686adfcc7-log.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/log.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/util.cpp:2:10: fatal error: 'libavutil/opt.h' file not found
  cargo:warning=#include <libavutil/opt.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/e0b6db6686adfcc7-util.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/util.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp:4:10: fatal error: 'libavcodec/avcodec.h' file not found
  cargo:warning=#include <libavcodec/avcodec.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/2cdb15a14ca8bd4d-ffmpeg_ram_encode.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_encode.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_decode.cpp:5:10: fatal error: 'libavcodec/avcodec.h' file not found
  cargo:warning=#include <libavcodec/avcodec.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/2cdb15a14ca8bd4d-ffmpeg_ram_decode.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/ffmpeg_ram/ffmpeg_ram_decode.cpp" with args clang did not execute successfully (status code exit status: 1).cargo:warning=/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/mux/mux.cpp:4:10: fatal error: 'libavcodec/avcodec.h' file not found
  cargo:warning=#include <libavcodec/avcodec.h>
  cargo:warning=         ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=1 error generated.

  exit status: 1
  cargo:warning=ToolExecError: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/83634e825ea98caf-mux.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/mux/mux.cpp" with args clang did not execute successfully (status code exit status: 1).

  --- stderr


  error occurred: Command "/home/ubuntu/android/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" "-O3" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/externals/nv-codec-headers_n11.1.5.2/include/ffnvcodec" "-I" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/common/platform/linux" "-I" "/home/ubuntu/vcpkg/installed/arm64-android/include" "--target=aarch64-linux-android21" "-o" "/home/ubuntu/rustdesk/target/aarch64-linux-android/release/build/hwcodec-2a80b437c886e22d/out/83634e825ea98caf-mux.o" "-c" "/home/ubuntu/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/74e8288/cpp/mux/mux.cpp" with args clang did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
note: If the build failed due to a missing target, you can run this command:
note: 
note:     rustup target install aarch64-linux-android

Steps

No response

Possible Solution(s)

No response

Notes

I tried to install ffmpeg and libavcodec-dev using apt, but the compilation still failed.

Version

cargo 1.80.0 (376290515 2024-07-16)
release: 1.80.0
commit-hash: 37629051518c3df9ac2c1744589362a02ecafa99
commit-date: 2024-07-16
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Ubuntu 22.4.0 (jammy) [64-bit]


flutter --version
Flutter 3.22.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b0850beeb2 (9 days ago) • 2024-07-16 21:43:41 -0700
Engine • revision 235db911ba
Tools • Dart 3.4.4 • DevTools 2.34.3

android-ndk-r23c

解决了吗 大哥

没有 搞定 强制cargo 安装的ffmpeg liunx版 然后修改文件夹名为aarch64-linux-android 让Android编译是能找到对应的.h文件 暂时这里没报错了 但是最终编译apk还很远

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

3 participants