Mediapipe 跟踪 AAR 构建失败:按架构过滤 AAR 本机库失败
Posted
技术标签:
【中文标题】Mediapipe 跟踪 AAR 构建失败:按架构过滤 AAR 本机库失败【英文标题】:Mediapipe Tracking AAR Build Failure: Filtering AAR native libs by architecture failed 【发布时间】:2021-12-26 05:59:17 【问题描述】:请帮助我。我是 Mediapipe 的新手,正在尝试使用 Bazel 构建用于对象检测和框跟踪解决方案的 AAR。我收到这个错误。如何解决这个问题?我的操作系统是 Ubuntu 20.04,OpenCV 是 4.2。
我的构建命令:
sudo -s bazel build -c opt --strip=ALWAYS --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --fat_apk_cpu=arm64-v8a,armeabi-v7a --sandbox_debug mediapipe/examples/android/src /java/com/google/mediapipe/apps/tracking_aar:tracking_aar.aar
WARNING: API level 30 specified by android_ndk_repository 'androidndk' is not available. Using latest known API level 29
WARNING: /home/bogdan/mediapipe/mediapipe/examples/android/src/java/com/google/mediapipe/apps/tracking_aar/BUILD:3:14: in linkstatic attribute of cc_library rule //mediapipe/examples/android/src/java/com/google/mediapipe/apps/tracking_aar:tracking_aar_jni_opencv_cc_lib: setting 'linkstatic=1' is recommended if there are no object files. Since this rule was created by the macro 'mediapipe_aar', the error might have been caused by the macro implementation
INFO: Analyzed target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/tracking_aar:tracking_aar.aar (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /root/.cache/bazel/_bazel_root/468a24854014423d00b43f31fb576f90/external/maven/BUILD:404:11: Filtering AAR native libs by architecture failed (Exit 127): linux-sandbox failed: error executing command
(cd /root/.cache/bazel/_bazel_root/468a24854014423d00b43f31fb576f90/sandbox/linux-sandbox/298/execroot/mediapipe && \
exec env - \
PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-3.7.2-linux-x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin \
TMPDIR=/tmp \
/root/.cache/bazel/_bazel_root/install/46850c2a96e4b4b07623822a03209f74/linux-sandbox -t 15 -w /root/.cache/bazel/_bazel_root/468a24854014423d00b43f31fb576f90/sandbox/linux-sandbox/298/execroot/mediapipe -w /tmp -w /dev/shm -D -- bazel-out/host/bin/external/bazel_tools/tools/android/aar_native_libs_zip_creator --input_aar external/maven/v1/https/maven.google.com/androidx/legacy/legacy-support-v4/1.0.0/legacy-support-v4-1.0.0.aar --cpu arm64-v8a --output_zip bazel-out/android-arm64-v8a-opt/bin/external/maven/_aar/androidx_legacy_legacy_support_v4/native_libs.zip) linux-sandbox failed: error executing command
(cd /root/.cache/bazel/_bazel_root/468a24854014423d00b43f31fb576f90/sandbox/linux-sandbox/298/execroot/mediapipe && \
exec env - \
PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-3.7.2-linux-x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin \
TMPDIR=/tmp \
/root/.cache/bazel/_bazel_root/install/46850c2a96e4b4b07623822a03209f74/linux-sandbox -t 15 -w /root/.cache/bazel/_bazel_root/468a24854014423d00b43f31fb576f90/sandbox/linux-sandbox/298/execroot/mediapipe -w /tmp -w /dev/shm -D -- bazel-out/host/bin/external/bazel_tools/tools/android/aar_native_libs_zip_creator --input_aar external/maven/v1/https/maven.google.com/androidx/legacy/legacy-support-v4/1.0.0/legacy-support-v4-1.0.0.aar --cpu arm64-v8a --output_zip bazel-out/android-arm64-v8a-opt/bin/external/maven/_aar/androidx_legacy_legacy_support_v4/native_libs.zip)
1636924764.970552089: src/main/tools/linux-sandbox.cc:152: calling pipe(2)...
1636924764.970586006: src/main/tools/linux-sandbox.cc:171: calling clone(2)...
1636924764.970857195: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 11739
1636924764.970877413: src/main/tools/linux-sandbox-pid1.cc:434: Pid1Main started
1636924764.970956716: src/main/tools/linux-sandbox.cc:197: done manipulating pipes
1636924764.971060773: src/main/tools/linux-sandbox-pid1.cc:176: working dir: /root/.cache/bazel/_bazel_root/468a24854014423d00b43f31fb576f90/sandbox/linux-sandbox/298/execroot/mediapipe
1636924764.971079714: src/main/tools/linux-sandbox-pid1.cc:208: writable: /root/.cache/bazel/_bazel_root/468a24854014423d00b43f31fb576f90/sandbox/linux-sandbox/298/execroot/mediapipe
1636924764.971088941: src/main/tools/linux-sandbox-pid1.cc:208: writable: /tmp
1636924764.971095861: src/main/tools/linux-sandbox-pid1.cc:208: writable: /dev/shm
1636924764.971164802: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /
1636924764.971174026: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /dev
1636924764.971180141: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /dev/pts
1636924764.971186487: src/main/tools/linux-sandbox-pid1.cc:279: remount rw: /dev/shm
1636924764.971191658: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /dev/hugepages
1636924764.971197387: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /dev/mqueue
1636924764.971203795: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run
1636924764.971209312: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run/lock
1636924764.971214952: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run/snapd/ns
1636924764.971221236: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run/user/125
1636924764.971227309: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run/user/125/gvfs
1636924764.971231675: src/main/tools/linux-sandbox-pid1.cc:300: remount(nullptr, /run/user/125/gvfs, nullptr, 2101287, nullptr) failure (Permission denied) ignored
1636924764.971249921: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run/user/1000
1636924764.971287473: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run/user/1000/gvfs
1636924764.971291993: src/main/tools/linux-sandbox-pid1.cc:300: remount(nullptr, /run/user/1000/gvfs, nullptr, 2101287, nullptr) failure (Permission denied) ignored
1636924764.971296776: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run/user/1000/doc
1636924764.971300173: src/main/tools/linux-sandbox-pid1.cc:300: remount(nullptr, /run/user/1000/doc, nullptr, 2101287, nullptr) failure (Permission denied) ignored
1636924764.971304839: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys
1636924764.971310464: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/kernel/security
1636924764.971318792: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup
1636924764.971325682: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/unified
1636924764.971332259: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/systemd
1636924764.971338279: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/pids
1636924764.971344497: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/memory
1636924764.971351008: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/net_cls,net_prio
1636924764.971357685: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/blkio
1636924764.971363823: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/cpuset
1636924764.971370098: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/cpu,cpuacct
1636924764.971402733: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/perf_event
1636924764.971409992: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/hugetlb
1636924764.971416069: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/rdma
1636924764.971421921: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/freezer
1636924764.971436336: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/devices
1636924764.971442801: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/pstore
1636924764.971449274: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/firmware/efi/efivars
1636924764.971456477: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/bpf
1636924764.971462497: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/kernel/debug
1636924764.971468995: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/kernel/tracing
1636924764.971475213: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/fuse/connections
1636924764.971482541: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/kernel/config
1636924764.971489104: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /proc
1636924764.971517126: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /proc/sys/fs/binfmt_misc
1636924764.971525793: src/main/tools/linux-sandbox-pid1.cc:300: remount(nullptr, /proc/sys/fs/binfmt_misc, nullptr, 2101281, nullptr) failure (Operation not permitted) ignored
1636924764.971531173: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /proc/sys/fs/binfmt_misc
1636924764.971538054: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/canonical-livepatch/114
1636924764.971544417: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/gtk-common-themes/1515
1636924764.971549690: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/android-studio/115
1636924764.971555046: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/snapd/12704
1636924764.971560604: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/snap-store/547
1636924764.971566061: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/gnome-3-34-1804/72
1636924764.971571523: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/core20/1169
1636924764.971577487: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/core/11993
1636924764.971583020: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/core18/2128
1636924764.971588808: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/sublime-text/110
1636924764.971595055: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /boot/efi
1636924764.971600911: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/core18/2246
1636924764.971618791: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/snapd/13640
1636924764.971624955: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/bare/5
1636924764.971630456: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /snap/gtk-common-themes/1519
1636924764.971636622: src/main/tools/linux-sandbox-pid1.cc:279: remount rw: /root/.cache/bazel/_bazel_root/468a24854014423d00b43f31fb576f90/sandbox/linux-sandbox/298/execroot/mediapipe
1636924764.971643799: src/main/tools/linux-sandbox-pid1.cc:279: remount rw: /root/.cache/bazel/_bazel_root/468a24854014423d00b43f31fb576f90/sandbox/linux-sandbox/298/execroot/mediapipe
1636924764.971649813: src/main/tools/linux-sandbox-pid1.cc:279: remount rw: /tmp
1636924764.971655231: src/main/tools/linux-sandbox-pid1.cc:279: remount rw: /dev/shm
1636924764.971710554: src/main/tools/linux-sandbox-pid1.cc:363: calling fork...
1636924764.971856507: src/main/tools/linux-sandbox-pid1.cc:393: child started with PID 2
/usr/bin/env: 'python': No such file or directory
1636924764.972488616: src/main/tools/linux-sandbox-pid1.cc:410: wait returned pid=2, status=0x7f00
1636924764.972495324: src/main/tools/linux-sandbox-pid1.cc:428: child exited normally with code 127
1636924764.972802538: src/main/tools/linux-sandbox.cc:233: child exited normally with code 127
Target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/tracking_aar:tracking_aar.aar failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.182s, Critical Path: 0.04s
INFO: 15 processes: 15 internal.
FAILED: Build did NOT complete successfully
【问题讨论】:
【参考方案1】:看起来错误是/usr/bin/env: 'python': No such file or directory
您的系统是否安装了python?安装python-is-python3
包可能会有所帮助。
【讨论】:
以上是关于Mediapipe 跟踪 AAR 构建失败:按架构过滤 AAR 本机库失败的主要内容,如果未能解决你的问题,请参考以下文章
找不到 play-services-auth-base-license.aar - Ionic android 构建失败
SignAll SDK:基于 MediaPipe 的手语接口现已开放