google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://mediapipe.dev
Apache License 2.0
26.13k stars 5.04k forks source link

android,0.9.3,build error #4324

Closed fengyun21 closed 4 months ago

fengyun21 commented 1 year ago

OS Platform and Distribution

macos13.3,android,0.9.3,xcode14.2

Compiler version

xcode-select version 2397

Programming Language and version

python3.11,openjdk version "20"

Installed using virtualenv? pip? Conda?(if python)

no

MediaPipe version

0.9.3

Bazel version

Bazelisk version: development,Build label: 6.1.1

XCode and Tulsi versions (if iOS)

xcode14.2

Android SDK and NDK versions (if android)

sdk30.0.3,ndk21.1.6352462

Android AAR (if android)

Yes

OpenCV version (if running on desktop)

maybe opencv3

Describe the problem

bazel build -c opt --config=android_arm64 mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu

Complete Logs

INFO: Found 1 target...
ERROR: /Users/apple/mediapipe/mediapipe/mediapipe/modules/palm_detection/BUILD:33:26: Linking mediapipe/modules/palm_detection/palm_detection_model_loader_graph_text_to_binary_graph [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //mediapipe/modules/palm_detection:palm_detection_model_loader_graph_text_to_binary_graph) external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418/bin/mediapipe/modules/palm_detection/palm_detection_model_loader_graph_text_to_binary_graph-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
stderr (/private/var/tmp/_bazel_apple/85fef98c262989ddaf244e3fdab8e148/execroot/mediapipe/bazel-out/_tmp/actions/stderr-2) 1460423 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping
ERROR: /Users/apple/mediapipe/mediapipe/mediapipe/modules/hand_landmark/BUILD:35:26: Linking mediapipe/modules/hand_landmark/hand_landmark_model_loader_graph_text_to_binary_graph [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //mediapipe/modules/hand_landmark:hand_landmark_model_loader_graph_text_to_binary_graph) external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418/bin/mediapipe/modules/hand_landmark/hand_landmark_model_loader_graph_text_to_binary_graph-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
stderr (/private/var/tmp/_bazel_apple/85fef98c262989ddaf244e3fdab8e148/execroot/mediapipe/bazel-out/_tmp/actions/stderr-3) 1460423 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping
ERROR: /Users/apple/mediapipe/mediapipe/mediapipe/modules/palm_detection/BUILD:61:26: Linking mediapipe/modules/palm_detection/palm_detection_gpu_graph_text_to_binary_graph [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //mediapipe/modules/palm_detection:palm_detection_gpu_graph_text_to_binary_graph) external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418/bin/mediapipe/modules/palm_detection/palm_detection_gpu_graph_text_to_binary_graph-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
stderr (/private/var/tmp/_bazel_apple/85fef98c262989ddaf244e3fdab8e148/execroot/mediapipe/bazel-out/_tmp/actions/stderr-6) 1872147 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping
Target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 32.222s, Critical Path: 4.76s
INFO: 10 processes: 10 internal.
FAILED: Build did NOT complete successfully
fengyun21 commented 1 year ago

i try 0.9.2.1 , it compile ok.

kuaashish commented 1 year ago

Hello @fengyun21, Would you please confirm that you are able to run the Hello_World example as noted here in the guide? Thank you

fengyun21 commented 1 year ago

Hello @fengyun21, Would you please confirm that you are able to run the Hello_World example as noted here in the guide? Thank you

the Hello_world example of framework compiled ok. but the android or ios example compiled failed.

gkubes commented 1 year ago

This might be related to https://github.com/bazelbuild/rules_apple/issues/1474


Sample build failure logs

duplicate symbol 'mediapipe::ImageFormat::GetMetadata() const' in:
    bazel-out/darwin-opt-exec-50AE0418/bin/mediapipe/framework/formats/libimage_format_cc_proto.lo(image_format.pb.o)
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-cfb676c6944e/bin/mediapipe/framework/formats/libimage_format_cc_proto.lo(image_format.pb.o)
...
duplicate symbol 'google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-cfb676c6944e/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
    bazel-out/darwin-opt-exec-50AE0418/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
ld: 3927 duplicate symbols for architecture x86_64
Evizero commented 1 year ago

I have the same issue. The linked issue seems quite old. I would have imagined this would affect more people

kuaashish commented 1 year ago

Hello @fengyun21, Apologies for the delayed response. Could you please confirm that still you are looking for resolution or the issue has been solved from your end. Thank you!

fengyun21 commented 1 year ago

Hello @fengyun21, Apologies for the delayed response. Could you please confirm that still you are looking for resolution or the issue has been solved from your end. Thank you!

Not resolved yet

Temporarily replaced with mediapipe of 0.9.2.1

kuaashish commented 1 year ago

@fengyun21,

We have released newer version mediapipe 0.10.0 as noted here the release notes. Please try out to build the Android example in latest version and let us know if still an issue from other end.

Thank you!

PrinceP commented 1 year ago

Same issue in mac, tried with v0.9.3.0 also but not working

fengyun21 commented 1 year ago

@fengyun21,

We have released newer version mediapipe 0.10.0 as noted here the release notes. Please try out to build the Android example in latest version and let us know if still an issue from other end.

Thank you!

Same issue in mac, tried with v0.10.0 also but not working

kuaashish commented 1 year ago

@fengyun21, Please allow us sometime to share the possible cause of the issue. Thank you

fengyun21 commented 1 year ago

@fengyun21, Please allow us sometime to share the possible cause of the issue. Thank you

maybe you can view this post: iOS compiling error, cc_wrapper.sh failed: error executing command

lyqaiym commented last weekhttps://github.com/bazelbuild/bazel src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java the line 89,new version ExecutionTransitionFactory.create(),old version HostTransition.createFactory(). old is ok. ExecutionTransitionFactory.java change coreOptions.isHost = true; bazel-bin/src/bazel-dev

kuaashish commented 1 year ago

@fengyun21,

Could you please reproduce this issue in the latest version 0.10.0 and report back to us if you see the similar failure as described here. We will definitely look into it further. However, We do not have similar machine to reproduce the issue from our end. Thank you!

github-actions[bot] commented 1 year ago

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

cancan101 commented 1 year ago

I am getting similar errors against current master (4c4a1d93b28f6f40ffcb11aa11cfbfc26ef0dc68) trying to run bazel build -c opt --config=android_arm64 mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu:

duplicate symbol 'descriptor_table_mediapipe_2fframework_2fformats_2fimage_5fformat_2eproto_getter()' in:
    bazel-out/darwin-opt-exec-50AE0418/bin/mediapipe/framework/formats/libimage_format_cc_proto.lo(image_format.pb.o)
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-cfb676c6944e/bin/mediapipe/framework/formats/libimage_format_cc_proto.lo(image_format.pb.o)
...
char_traits<char>, std::__1::allocator<char> >*)' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-cfb676c6944e/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
    bazel-out/darwin-opt-exec-50AE0418/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
ld: 3927 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in child process '/usr/bin/xcrun'. 1
cancan101 commented 1 year ago

I can confirm that for me, Android builds against v0.9.3.0 fail whereas I can successfully build against v0.9.2.1.

trungdinhth commented 1 year ago

I've tested with v0.10.1 the problem persists for macOS with x86_64, even though on M1 arm64, there is no problem.

kuaashish commented 11 months ago

@schmidt-sebastian,

I am able to reproduce the issue in macOS Intel Core i7, with v0.10.2And encountering the same error as screenshot attached below. Could you please share any possible reason of the build failure.

Screenshot 2023-07-19 at 2 36 09 PM

Thank you

kuaashish commented 5 months ago

Hi @fengyun21,

Could you please confirm if you still require assistance with this matter? If so, we would like to inform you that AAR solutions for app development are no longer under maintenance, and we anticipate that the reported issue will not be resolved.

Instead, we recommend utilizing our new Hand Landmarker Task API. This API is an enhanced version of our legacy Hand Solution. Further details can be found here.

Additionally, you may refer to the corresponding Overview documentation and implementation instructions for Android on this page. Should you encounter any issues during implementation, please feel free to report them to us.

Thank you!!

github-actions[bot] commented 5 months ago

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] commented 4 months ago

This issue was closed due to lack of activity after being marked stale for past 7 days.

google-ml-butler[bot] commented 4 months ago

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