1

Now I'm building android aar for mediapipe sample. BUT failed for Following error

how can i resolve error and build aar?

on Mac Pro M1 (13.0.1)

Mac M1 is not support? making aar ?

following is build command

bazel build -c opt —strip=ALWAYS \
    —host_crosstool_top=@bazel_tools//tools/cpp:toolchain \
    —fat_apk_cpu=arm64-v8a \
    —legacy_whole_archive=0 \
    —features=-legacy_whole_archive \
    —copt=-fvisibility=hidden \
    —copt=-ffunction-sections \
    —copt=-fdata-sections \
    —copt=-fstack-protector \
    —copt=-Oz \
    —copt=-fomit-frame-pointer \
    —copt=-DABSL_MIN_LOG_LEVEL=2 \
    —linkopt=-Wl,—gc-sections,—strip-all \
    //mediapipe/examples/android/src/java/com/google/mediapipe/apps/test:mediapipe_face_detection.aar

following is error log



/mediapipe/mediapipe/gpu/BUILD:103:11: Illegal ambiguous match on configurable attribute "linkopts" in //mediapipe/gpu:gl_base:
//mediapipe:android
//mediapipe:macos
Multiple matches are not allowed unless one is unambiguously more specialized.
INFO: Repository eigen_archive instantiated at:
  /Users/dd/mediapipe/mediapipe/WORKSPACE:512:14: in <toplevel>
  /private/var/tmp/_bazel_dd/dfe6c1cb11887963760080ded44a6de9/external/org_tensorflow/tensorflow/workspace2.bzl:988:28: in workspace
  /private/var/tmp/_bazel_dd/dfe6c1cb11887963760080ded44a6de9/external/org_tensorflow/tensorflow/workspace2.bzl:67:11: in _initialize_third_party
  /private/var/tmp/_bazel_dd/dfe6c1cb11887963760080ded44a6de9/external/org_tensorflow/third_party/eigen3/workspace.bzl:14:20: in repo
  /private/var/tmp/_bazel_dd/dfe6c1cb11887963760080ded44a6de9/external/org_tensorflow/third_party/repo.bzl:136:21: in tf_http_archive
Repository rule _tf_http_archive defined at:
  /private/var/tmp/_bazel_dd/dfe6c1cb11887963760080ded44a6de9/external/org_tensorflow/third_party/repo.bzl:89:35: in <toplevel>
INFO: Repository android_opencv instantiated at:
  /Users/dd/mediapipe/mediapipe/WORKSPACE:359:13: in <toplevel>
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_dd/dfe6c1cb11887963760080ded44a6de9/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
ERROR: Analysis of target '//mediapipe/examples/android/src/java/com/google/mediapipe/apps/test:mediapipe_face_detection.aar' failed; build aborted: 
INFO: Elapsed time: 5.168s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (119 packages loaded, 7856 targets configured)
    Fetching repository @local_config_xcode; Fetching the default Xcode version
    Fetching https://storage.googleapis.com/.../archive/0b51f763cbbd0ed08168f88972724329f0375498/eigen-0b51f763cbbd0ed08168f88972724329f0375498.tar.gz
    Fetching https://github.com/opencv/opencv/releases/download/3.4.3/opencv-3.4.3-android-sdk.zip

error corrupted so could not do anything.

please add comment for this error~~~~

Daniel
  • 11
  • 2
  • I'm making some guesses here since the logs you're showing don't tell me much, but it appears you're trying to build an outdated sample. The latest face detection sample can be found here: https://github.com/googlesamples/mediapipe/tree/main/examples/face_detector/android – Jen Person Aug 23 '23 at 18:38

0 Answers0