homuler / MediaPipeUnityPlugin

Unity plugin to run MediaPipe
MIT License
1.79k stars 466 forks source link

Cannot build AAR on Windows #80

Closed AlanWuJinliang closed 3 years ago

AlanWuJinliang commented 3 years ago

I've run it successfully in windows , but Build android libraries has a error. hope you can give me some suggest.

ERROR: C:/msys64/home/wujinliang/_bazel_wujinliang/2pedqfuc/external/XNNPACK/BUILD.bazel:4629:19: Compiling src/subgraph/leaky-relu.c failed: (Exit 1): clang failed: error executing command external/androidndk/ndk/toolchains/llvm/prebuilt/windows-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64 -target ... (remaining 112 argument(s) skipped) clang: error: no such file or directory: '/w' clang: error: no such file or directory: '/D_USE_MATH_DEFINES' INFO: Elapsed time: 275.955s, Critical Path: 133.97s INFO: 1378 processes: 619 internal, 759 local. FAILED: Build did NOT complete successfully make: *** [Makefile:52: android_arm64] Error 1

homuler commented 3 years ago

Currently building apk on Windows doesn't work (cf. https://github.com/homuler/MediaPipeUnityPlugin/issues/59#issuecomment-779152562 ). Will you try building on WSL2, please?

AlanWuJinliang commented 3 years ago

@homuler linux has some trouble , are you succeed build this in mac os?

can you share the Android libraries and ios libraries ?

thx

AlanWuJinliang commented 3 years ago

@homuler Sorry I didn't provide the log, this is the full log

ubuntu-alan@HIH-D-25710:~$ pip3 install numpy --user Requirement already satisfied: numpy in ./.local/lib/python3.8/site-packages (1.20.1)

ubuntu-alan@HIH-D-25710:~/MediaPipeUnityPlugin$ make cpu && make install

`Build succeeded. 0 Warning(s) 0 Error(s)

Time Elapsed 00:00:10.30 cd C && bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe_api:mediapipe_desktop mediapipe_api:mediapipe_assets mediapipe_api:mediapipe_proto_srcs /bin/sh: 1: bazel: not found`

here show bazel nott found but I have Bazel installed ubuntu-alan@HIH-D-25710:~/MediaPipeUnityPlugin$ bazel --version bazel 3.4.1

so i copy this as a new command. cd C && bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe_api:mediapipe_desktop mediapipe_api:mediapipe_assets mediapipe_api:mediapipe_proto_srcs

result:

ERROR: /home/ubuntu-alan/.cache/bazel/_bazel_ubuntu-alan/7ebc18ee30a6074d9bd1fd5cf028c213/external/local_config_cc/BUILD:47:19: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'ios_arm64' ERROR: Analysis of target '//mediapipe_api/objc:MediaPipeUnity' failed; build aborted: Analysis failed INFO: Elapsed time: 11.210s INFO: 0 processes. FAILED: Build did NOT complete successfully (37 packages loaded, 229 targets configured) Fetching @ios_opencv; fetching

homuler commented 3 years ago

Although it depends on your machine, you need macOS (Xcode) generally if you'd like to build iOS frameworks.

homuler commented 3 years ago

And I guess the log you shared is not the result of the command you said you'd run. If you'd like to build native libaries for linux, please run the below command first and share the log.

cd C && bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --sandbox_debug mediapipe_api:mediapipe_desktop
AlanWuJinliang commented 3 years ago

Command: ubuntu-alan@HIH-D-25710:~/MediaPipeUnityPlugin/C$ bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --sandbox_debug me diapipe_api:mediapipe_desktop

result: Target //mediapipe_api:mediapipe_desktop up-to-date: bazel-bin/mediapipe_api/mediapipe_desktop.zip INFO: Elapsed time: 1.082s, Critical Path: 0.00s INFO: 0 processes. INFO: Build completed successfully, 1 total action

AlanWuJinliang commented 3 years ago

full result: INFO: Analyzed target //mediapipe_api:mediapipe_desktop (0 packages loaded, 0 targets configured). INFO: Found 1 target... Target //mediapipe_api:mediapipe_desktop up-to-date: bazel-bin/mediapipe_api/mediapipe_desktop.zip INFO: Elapsed time: 1.082s, Critical Path: 0.00s INFO: 0 processes. INFO: Build completed successfully, 1 total action

homuler commented 3 years ago

Well, then you've already built it successfully, haven't you? I can't see what your problem is.

Does the error still occur if you run make cpu && make install?

AlanWuJinliang commented 3 years ago

command:make install

result: cd C && bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe_api:mediapipe_desktop mediapipe_api:mediapipe_assets mediapipe_api:mediapipe_proto_srcs /bin/sh: 1: bazel: not found make: *** [Makefile:46: cpu] Error 127

command:cd C && bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe_api:mediapipe_desktop mediapipe_api:mediapipe_assets mediapipe_api:mediapipe_proto_srcs

result: INFO: Analyzed 3 targets (0 packages loaded, 0 targets configured). INFO: Found 3 targets... INFO: Elapsed time: 1.012s, Critical Path: 0.00s INFO: 0 processes. INFO: Build completed successfully, 1 total action

then make install start unity and run

error: DllNotFoundException: mediapipe_c Mediapipe.ResourceManager..ctor () (at Assets/MediaPipe/SDK/Scripts/Util/ResourceManager.cs:23) Mediapipe.LocalAssetManager..ctor () <0x20dc667baf0 + 0x00052> in <2a6f54adbed745fb8cfb7fdc7c197645>:0 LocalAssetLoader.Start () (at Assets/MediaPipe/Examples/Scripts/ResourceManager/LocalAssetLoader.cs:5)

NullReferenceException: Object reference not set to an instance of an object LocalAssetLoader.PrepareAsset (System.String name, System.String uniqueKey, System.Boolean overwrite) (at Assets/MediaPipe/Examples/Scripts/ResourceManager/LocalAssetLoader.cs:9) DemoGraph.PrepareDependentAsset (System.String assetName, System.String uniqueKey, System.Boolean overwrite) (at Assets/MediaPipe/Examples/Scripts/DemoGraph.cs:192) DemoGraph.PrepareDependentAsset (System.String assetName, System.Boolean overwrite) (at Assets/MediaPipe/Examples/Scripts/DemoGraph.cs:196) FaceDetectionGraph.PrepareDependentAssets () (at Assets/MediaPipe/Examples/Graphs/FaceDetection/Scripts/FaceDetectionGraph.cs:44) DemoGraph.Initialize () (at Assets/MediaPipe/Examples/Scripts/DemoGraph.cs:46) SceneDirector+d__23.MoveNext () (at Assets/MediaPipe/Examples/Scripts/SceneDirector.cs:171) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0)

homuler commented 3 years ago

How about running make cpu SHELL=/bin/bash ? And I'd also like to see the log when you run make install.

AlanWuJinliang commented 3 years ago

command :make cpu SHELL=/bin/bash

result:cd C && bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe_api:mediapipe_desktop mediapipe_api:mediapipe_assets mediapipe_api:mediapipe_proto_srcs /bin/bash: bazel: command not found make: *** [Makefile:46: cpu] Error 127

command : make install

result:

cp .build/protobuf-3.13.0/csharp/src/Google.Protobuf/bin/Release/net45/* Assets/MediaPipe/SDK/Plugins/Protobuf
unzip C/bazel-bin/mediapipe_api/mediapipe_desktop.zip -d Assets/MediaPipe/SDK/Plugins
Archive:  C/bazel-bin/mediapipe_api/mediapipe_desktop.zip
replace Assets/MediaPipe/SDK/Plugins/libmediapipe_c.so? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: Assets/MediaPipe/SDK/Plugins/libmediapipe_c.so
# skip installing mediapipe_android.aar
# skip installing MediaPipeUnityFramework.zip
unzip C/bazel-bin/mediapipe_api/mediapipe_assets.zip -d Assets/MediaPipe/SDK/Resources
Archive:  C/bazel-bin/mediapipe_api/mediapipe_assets.zip
replace Assets/MediaPipe/SDK/Resources/robot.obj.bytes? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: Assets/MediaPipe/SDK/Resources/robot.obj.bytes
  inflating: Assets/MediaPipe/SDK/Resources/robot_texture.bytes
  inflating: Assets/MediaPipe/SDK/Resources/sneaker_texture.bytes
  inflating: Assets/MediaPipe/SDK/Resources/chair_texture.bytes
  inflating: Assets/MediaPipe/SDK/Resources/cup_texture.bytes
  inflating: Assets/MediaPipe/SDK/Resources/camera_texture.bytes
  inflating: Assets/MediaPipe/SDK/Resources/sneaker.obj.bytes
  inflating: Assets/MediaPipe/SDK/Resources/chair.obj.bytes
  inflating: Assets/MediaPipe/SDK/Resources/cup.obj.bytes
  inflating: Assets/MediaPipe/SDK/Resources/camera.obj.bytes
  inflating: Assets/MediaPipe/SDK/Resources/box.obj.bytes
  inflating: Assets/MediaPipe/SDK/Resources/classic_colors.bytes
  inflating: Assets/MediaPipe/SDK/Resources/hair_segmentation.bytes
  inflating: Assets/MediaPipe/SDK/Resources/ssdlite_object_detection.bytes
  inflating: Assets/MediaPipe/SDK/Resources/ssdlite_object_detection_labelmap.txt
  inflating: Assets/MediaPipe/SDK/Resources/face_detection_front.bytes
  inflating: Assets/MediaPipe/SDK/Resources/face_landmark.bytes
  inflating: Assets/MediaPipe/SDK/Resources/hand_landmark.bytes
  inflating: Assets/MediaPipe/SDK/Resources/handedness.txt
  inflating: Assets/MediaPipe/SDK/Resources/hand_recrop.bytes
  inflating: Assets/MediaPipe/SDK/Resources/iris_landmark.bytes
  inflating: Assets/MediaPipe/SDK/Resources/object_detection_3d_camera.bytes
  inflating: Assets/MediaPipe/SDK/Resources/object_detection_3d_chair.bytes
  inflating: Assets/MediaPipe/SDK/Resources/object_detection_3d_chair_1stage.bytes
  inflating: Assets/MediaPipe/SDK/Resources/object_detection_3d_cup.bytes
  inflating: Assets/MediaPipe/SDK/Resources/object_detection_3d_sneakers.bytes
  inflating: Assets/MediaPipe/SDK/Resources/object_detection_3d_sneakers_1stage.bytes
  inflating: Assets/MediaPipe/SDK/Resources/object_detection_oidv4_labelmap.txt
  inflating: Assets/MediaPipe/SDK/Resources/object_detection_ssd_mobilenetv2_oidv4_fp16.bytes
  inflating: Assets/MediaPipe/SDK/Resources/palm_detection.bytes
  inflating: Assets/MediaPipe/SDK/Resources/pose_detection.bytes
  inflating: Assets/MediaPipe/SDK/Resources/pose_landmark_upper_body.bytes
  inflating: Assets/MediaPipe/SDK/Resources/pose_landmark_full_body.bytes
unzip C/bazel-bin/mediapipe_api/mediapipe_proto_srcs.zip -d Assets/MediaPipe/SDK/Scripts/Protobuf
Archive:  C/bazel-bin/mediapipe_api/mediapipe_proto_srcs.zip
replace Assets/MediaPipe/SDK/Scripts/Protobuf/Calculator.cs? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/Calculator.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/CalculatorOptions.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/MediapipeOptions.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/PacketFactory.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/PacketGenerator.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/StatusHandler.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/StreamHandler.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/Classification.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/Detection.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/Landmark.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/LocationData.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/Rasterization.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/Rect.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/StickerBuffer.cs
  inflating: Assets/MediaPipe/SDK/Scripts/Protobuf/ModelMatrix.cs
homuler commented 3 years ago

Where is bazel installed and is it set to PATH ?

which bazel
echo $PATH
AlanWuJinliang commented 3 years ago

it is looks like bazel probrem...

ubuntu-alan@HIH-D-25710:~$ bazel --version bazel 3.4.1 ubuntu-alan@HIH-D-25710:~$ which bazel ubuntu-alan@HIH-D-25710:~$ echo $PATH /home/ubuntu-alan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/windows/System32/OpenSSH/:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/130/Tools/Binn/:/mnt/c/Program Files (x86)/Microsoft SQL Server/140/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/140/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/140/DTS/Binn/:/mnt/c/Program Files (x86)/GtkSharp/2.12/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit/:/mnt/c/Program Files/dotnet/:/mnt/c/Users/wujinliang/AppData/Local/Programs/Python/Python38/Scripts/:/mnt/c/Users/wujinliang/AppData/Local/Programs/Python/Python38/:/mnt/c/Users/wujinliang/AppData/Local/Microsoft/WindowsApps:/mnt/c/src/flutter/bin:/mnt/c/msys64/usr/bin:/mnt/c/bazel:/mnt/c/Users/wujinliang/AppData/Local/Programs/Python/Python38:/mnt/c/Program Files/dotnet:/mnt/c/Users/wujinliang/.dotnet/tools:/snap/bin:/home/ubuntu-alan/.dotnet/tools

AlanWuJinliang commented 3 years ago

by the way , there is build ios in mac os. error:

MacBook-Pro MediaPipeUnityPlugin %  make ios_arm64
cd C && bazel build -c opt --config=ios_arm64 --copt=-fembed-bitcode --apple_bitcode=embedded mediapipe_api/objc:MediaPipeUnity mediapipe_api:mediapipe_assets mediapipe_api:mediapipe_proto_srcs
ERROR: /private/var/tmp/_bazel_alan/7d3f5562cb55fafea5f1c5b1dd2c9dd7/external/build_bazel_rules_apple/tools/realpath/BUILD:9:14: in _apple_genrule_inner rule @build_bazel_rules_apple//tools/realpath:realpath_genrule: 
Traceback (most recent call last):
    File "/private/var/tmp/_bazel_alan/7d3f5562cb55fafea5f1c5b1dd2c9dd7/external/build_bazel_apple_support/rules/apple_genrule.bzl", line 78, column 28, in _apple_genrule_impl
        apple_support.run_shell(
    File "/private/var/tmp/_bazel_alan/7d3f5562cb55fafea5f1c5b1dd2c9dd7/external/build_bazel_apple_support/lib/apple_support.bzl", line 326, column 26, in _run_shell
        ctx.actions.run_shell(**_kwargs_for_apple_platform(ctx, **kwargs))
Error in run_shell: 'command' must be of type string. passing a sequence of strings as 'command' is deprecated. To temporarily disable this check, set --incompatible_run_shell_command_string=false.
ERROR: Analysis of target '//mediapipe_api/objc:MediaPipeUnity' failed; build aborted: Analysis of target '@build_bazel_rules_apple//tools/realpath:realpath_genrule' failed
INFO: Elapsed time: 0.114s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
make: *** [ios_arm64] Error 1

can you give me some suggest?

homuler commented 3 years ago

Probably you have installed bazel to your Windows, but you've not installed it to Ubuntu (WSL 2), have you?

And in macOS case, what is your bazel version?

AlanWuJinliang commented 3 years ago

in macOS :the bazel version is 4.0.0

in ubuntu : i just follow the course. https://google.github.io/mediapipe/getting_started/install.html#installing-on-windows-subsystem-for-linux-wsl

homuler commented 3 years ago

Will you try with bazel 3.7.2?

AlanWuJinliang commented 3 years ago

@homuler a good news is use bazel 3.7.2 is build succeed! and i can run it in unity on ios platform. but when i build in iphone8, it crash...
shold i do some setting when build ios?

AlanWuJinliang commented 3 years ago

@homuler i fix it , now it can run in ios. thx, why i cant build Android in mac os? it has error,

ERROR: /private/var/tmp/_bazel_alan/7d3f5562cb55fafea5f1c5b1dd2c9dd7/external/com_google_mediapipe/mediapipe/java/com/google/mediapipe/framework/jni/BUILD:27:11: C++ compilation of rule '@com_google_mediapipe//mediapipe/java/com/google/mediapipe/framework/jni:mediapipe_framework_jni' failed (Exit 1): clang failed: error executing command external/androidndk/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64 -target ... (remaining 81 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox clang failed: error executing command external/androidndk/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64 -target ... (remaining 81 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
src/main/tools/process-wrapper-legacy.cc:80: "execvp(external/androidndk/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang, ...)": No such file or directory
INFO: Elapsed time: 67.423s, Critical Path: 59.29s
INFO: 852 processes: 171 internal, 637 darwin-sandbox, 44 worker.
FAILED: Build did NOT complete successfully
make: *** [android_arm64] Error 1
some2014 commented 3 years ago

Looks like an issue with the NDK version.

AlanWuJinliang commented 3 years ago

Looks like an issue with the NDK version.

The ndk 21

some2014 commented 3 years ago

Looks like an issue with the NDK version.

The ndk 21

try ndk 18 :)

homuler commented 3 years ago

Use --sandbox_debug to see verbose messages from the sandbox

Please follow the above instructions first, and share the log.

cd C && bazel build -c opt --config=android_arm64 --sandbox_debug mediapipe_api/java/org/homuler/mediapipe/unity:mediapipe_android
AlanWuJinliang commented 3 years ago

this is the log :

5 warnings generated.

ERROR: /private/var/tmp/_bazel_alan/7d3f5562cb55fafea5f1c5b1dd2c9dd7/external/org_tensorflow/tensorflow/lite/delegates/gpu/gl/kernels/BUILD:717:11: C++ compilation of rule '@org_tensorflow//tensorflow/lite/delegates/gpu/gl/kernels:resize' failed (Exit 1): sandbox-exec failed: error executing command 
  (cd /private/var/tmp/_bazel_alan/7d3f5562cb55fafea5f1c5b1dd2c9dd7/sandbox/darwin-sandbox/102/execroot/mediapipe_api && \
  exec env - \
    PATH='/Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:.:/Users/alan/bin:/Users/alan/Library/Android/sdk:/Users/alan/Library/android-ndk-r21e' \
    PWD=/proc/self/cwd \
    TMPDIR=/var/folders/h1/gyc7pnn17lj5yc8_gbkwfc140000gn/T/ \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_alan/7d3f5562cb55fafea5f1c5b1dd2c9dd7/sandbox/darwin-sandbox/102/sandbox.sb /var/tmp/_bazel_alan/install/e5700781a43090e74aa4012c7e525e2a/process-wrapper '--timeout=0' '--kill_delay=15' external/androidndk/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64 -target aarch64-none-linux-android -fpic -isystemexternal/androidndk/ndk/sysroot/usr/include/aarch64-linux-android '-D__ANDROID_API__=29' -no-canonical-prefixes -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -funwind-tables -fstack-protector-strong -fno-addrsig '-Werror=return-type' '-Werror=int-to-pointer-cast' '-Werror=pointer-to-int-cast' '-Werror=implicit-function-declaration' -O2 -g -DNDEBUG -MD -MF bazel-out/android-arm64-v8a-opt/bin/external/org_tensorflow/tensorflow/lite/delegates/gpu/gl/kernels/_objs/resize/resize.pic.d '-frandom-seed=bazel-out/android-arm64-v8a-opt/bin/external/org_tensorflow/tensorflow/lite/delegates/gpu/gl/kernels/_objs/resize/resize.pic.o' -fPIC -iquote external/org_tensorflow -iquote bazel-out/android-arm64-v8a-opt/bin/external/org_tensorflow -iquote external/com_google_absl -iquote bazel-out/android-arm64-v8a-opt/bin/external/com_google_absl -iquote external/FP16 -iquote bazel-out/android-arm64-v8a-opt/bin/external/FP16 -Ibazel-out/android-arm64-v8a-opt/bin/external/FP16/_virtual_includes/FP16 -isystem external/FP16/include -isystem bazel-out/android-arm64-v8a-opt/bin/external/FP16/include -w '-std=c++17' '--sysroot=external/androidndk/ndk/platforms/android-29/arch-arm64' -isystem external/androidndk/ndk/sources/cxx-stl/llvm-libc++/include -isystem external/androidndk/ndk/sources/cxx-stl/llvm-libc++abi/include -isystem external/androidndk/ndk/sources/android/support/include -isystemexternal/androidndk/ndk/sysroot/usr/include -c external/org_tensorflow/tensorflow/lite/delegates/gpu/gl/kernels/resize.cc -o bazel-out/android-arm64-v8a-opt/bin/external/org_tensorflow/tensorflow/lite/delegates/gpu/gl/kernels/_objs/resize/resize.pic.o) sandbox-exec failed: error executing command 
  (cd /private/var/tmp/_bazel_alan/7d3f5562cb55fafea5f1c5b1dd2c9dd7/sandbox/darwin-sandbox/102/execroot/mediapipe_api && \
  exec env - \
    PATH='/Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:.:/Users/alan/bin:/Users/alan/Library/Android/sdk:/Users/alan/Library/android-ndk-r21e' \
    PWD=/proc/self/cwd \
    TMPDIR=/var/folders/h1/gyc7pnn17lj5yc8_gbkwfc140000gn/T/ \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_alan/7d3f5562cb55fafea5f1c5b1dd2c9dd7/sandbox/darwin-sandbox/102/sandbox.sb /var/tmp/_bazel_alan/install/e5700781a43090e74aa4012c7e525e2a/process-wrapper '--timeout=0' '--kill_delay=15' external/androidndk/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64 -target aarch64-none-linux-android -fpic -isystemexternal/androidndk/ndk/sysroot/usr/include/aarch64-linux-android '-D__ANDROID_API__=29' -no-canonical-prefixes -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -funwind-tables -fstack-protector-strong -fno-addrsig '-Werror=return-type' '-Werror=int-to-pointer-cast' '-Werror=pointer-to-int-cast' '-Werror=implicit-function-declaration' -O2 -g -DNDEBUG -MD -MF bazel-out/android-arm64-v8a-opt/bin/external/org_tensorflow/tensorflow/lite/delegates/gpu/gl/kernels/_objs/resize/resize.pic.d '-frandom-seed=bazel-out/android-arm64-v8a-opt/bin/external/org_tensorflow/tensorflow/lite/delegates/gpu/gl/kernels/_objs/resize/resize.pic.o' -fPIC -iquote external/org_tensorflow -iquote bazel-out/android-arm64-v8a-opt/bin/external/org_tensorflow -iquote external/com_google_absl -iquote bazel-out/android-arm64-v8a-opt/bin/external/com_google_absl -iquote external/FP16 -iquote bazel-out/android-arm64-v8a-opt/bin/external/FP16 -Ibazel-out/android-arm64-v8a-opt/bin/external/FP16/_virtual_includes/FP16 -isystem external/FP16/include -isystem bazel-out/android-arm64-v8a-opt/bin/external/FP16/include -w '-std=c++17' '--sysroot=external/androidndk/ndk/platforms/android-29/arch-arm64' -isystem external/androidndk/ndk/sources/cxx-stl/llvm-libc++/include -isystem external/androidndk/ndk/sources/cxx-stl/llvm-libc++abi/include -isystem external/androidndk/ndk/sources/android/support/include -isystemexternal/androidndk/ndk/sysroot/usr/include -c external/org_tensorflow/tensorflow/lite/delegates/gpu/gl/kernels/resize.cc -o bazel-out/android-arm64-v8a-opt/bin/external/org_tensorflow/tensorflow/lite/delegates/gpu/gl/kernels/_objs/resize/resize.pic.o)
src/main/tools/process-wrapper-legacy.cc:80: "execvp(external/androidndk/ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang, ...)": No such file or directory
Target //mediapipe_api/java/org/homuler/mediapipe/unity:mediapipe_android failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 55.582s, Critical Path: 33.13s
INFO: 239 processes: 140 internal, 99 darwin-sandbox.
FAILED: Build did NOT complete successfully
homuler commented 3 years ago

It looks like $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang is missing. Does it exist?

If it does not exist, you may have failed to install Android NDK properly.

AlanWuJinliang commented 3 years ago

i want to know how to install android ndk for mac ,i try to download the ndk for mac and use Android Studio install then
add it in path. but it looks all doesnt work; can you tell me how to install ?

homuler commented 3 years ago

See https://developer.android.com/studio/projects/install-ndk#specific-version

homuler commented 3 years ago

Will you create another issue with detailed logs, please?