google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.52k stars 5.16k forks source link

MediaPipe Android Archive ERROR #3412

Closed gavel94 closed 2 years ago

gavel94 commented 2 years ago

Describe the problem: "bazel run --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 \ mediapipe/examples/desktop/hello_world:hello_world" is successful. Problems with the bazel version? I read the log that bazel couldn't find the toolchain?

Provide the exact sequence of commands / steps that you executed before running into the problem:

Complete Logs: Include Complete Log information or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached: gavel@gavel-virtual-machine:/usr/local/mediapipe$ bazel build -c opt --strip=ALWAYS \

--host_crosstool_top=@bazel_tools//tools/cpp:toolchain \
--fat_apk_cpu=arm64-v8a,armeabi-v7a \
--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/aar_example:mediapipe_face_detection.aar

DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'com_google_absl' because it already exists. DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'com_google_benchmark' because it already exists. DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'pybind11_bazel' because it already exists. DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'com_google_protobuf' because it already exists. DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'com_google_googletest' because it already exists. DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists. DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists. DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists. DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'build_bazel_apple_support' because it already exists. DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'xctestrunner' because it already exists. DEBUG: /home/gavel/.cache/bazel/_bazel_gavel/462cd1bf5fd25a4910344f60f0511903/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'pybind11' because it already exists. ERROR: /usr/local/mediapipe/mediapipe/examples/android/src/java/com/google/mediapipe/apps/aar_example/BUILD:3:14: While resolving toolchains for target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/aar_example:mediapipe_face_detection_android_lib: no matching toolchains found for types @bazel_tools//tools/android:sdk_toolchain_type ERROR: Analysis of target '//mediapipe/examples/android/src/java/com/google/mediapipe/apps/aar_example:mediapipe_face_detection.aar' failed; build aborted: INFO: Elapsed time: 0.356s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf\ igured)

sureshdagooglecom commented 2 years ago

Hi @gavel94 , Could you provide steps to reproduce this issue.

gavel94 commented 2 years ago

Install MediaPipe according to the documentation.After running the c++ example successfully. Create a mediapipe_aar() target. """ gavel@gavel-virtual-machine:/usr/local/mediapipe/mediapipe/examples/android/src/java/com/google/mediapipe/apps/aar_example$ pwd /usr/local/mediapipe/mediapipe/examples/android/src/java/com/google/mediapipe/apps/aar_example gavel@gavel-virtual-machine:/usr/local/mediapipe/mediapipe/examples/android/src/java/com/google/mediapipe/apps/aar_example$ cat BUILD load("//mediapipe/java/com/google/mediapipe:mediapipe_aar.bzl", "mediapipe_aar")

mediapipe_aar( name = "mediapipe_face_detection", calculators = ["//mediapipe/graphs/face_detection:mobile_calculators"], ) gavel@gavel-virtual-machine:/usr/local/mediapipe/mediapipe/examples/android/src/java/com/google/mediapipe/apps/aar_example$

""" The next step run: """ gavel@gavel-virtual-machine:/usr/local/mediapipe$ bazel build -c opt --strip=ALWAYS --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --fat_apk_cpu=arm64-v8a,armeabi-v7a --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/aar_example:mediapipe_face_detection.aar

"""

After executing this specification, the expected result is not obtained.The log is on top。

kuaashish commented 2 years ago

Hi @gavel94!, Have you looked at this closed issue #1239 and comment. Please let us know if this resolves the issue. Thank you!

gavel94 commented 2 years ago

I haven't seen it. I'm going to try it now. Thank you for your help.

google-ml-butler[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 2 years ago

Are you satisfied with the resolution of your issue? Yes No