Repository: homuler/MediaPipeUnityPlugin

Issue #387: Building AAR on Windows
Created: 2021-12-21T12:29:34Z
ERROR: C:/_bzl/b2b5753g/external/com_google_mediapipe/mediapipe/graphs/object_detection_3d/calculators/BUILD:30:24: Linking external/com_google_mediapipe/mediapipe/graphs/object_detection_3d/calculators/libannotations_to_model_matrices_calculator_cc_proto.pic.lo failed: (Exit 1): aarch64-linux-android-ar failed: error executing command
cd C:/_bzl/b2b5753g/execroot/mediapipe_api
SET PATH=C:\msys64\usr\bin;C:\msys64\bin;C:\Windows;C:\Windows\System32;C:\Windows\System32\WindowsPowerShell\v1.0;D:\MediaPipePlugin\env\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\ProgramData\chocolatey\bin;C:\nuget;C:\Users\Capermint\AppData\Local\Programs\Python\Python310\Scripts;C:\Users\Capermint\AppData\Local\Programs\Python\Python310;C:\opencv\build\bin;C:\msys64\usr\bin;C:\Program Files\Android\Android Studio\jre;C:\Users\Capermint\AppData\Local\Android\Sdk\ndk;C:\Users\Capermint\AppData\Local\Android\Sdk;C:\Users\Capermint\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\Capermint\AppData\Local\Programs\Python\Python39;C:\Users\Capermint\AppData\Local\Microsoft\WindowsApps;C:\Users\Capermint\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\JetBrains\JetBrains Rider 2021.2.1\bin;C:\Users\Capermint\Desktop\bazel-4.2.0-windows-x86_64.exe;;C:\Users\Capermint.dotnet\tools;C:\Users\Capermint\AppData\Local\GitHubDesktop\bin;C:\Users\Capermint\AppData\Local\Android\Sdk\ndk;C:\Users\Capermint\AppData\Local\Android\Sdk;C:\Program Files\Android\Android Studio\jre;
SET PROCESSOR_ARCHITECTURE=AMD64
SET PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
SET PROCESSOR_LEVEL=6
SET PROCESSOR_REVISION=2a07
SET PWD=/proc/self/cwd
SET PYTHON_BIN_PATH=C://Users//Capermint//AppData//Local//Programs//Python//Python39//python.exe
SET ProgramData=C:\ProgramData
SET RUNFILES_MANIFEST_ONLY=1
external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/bin/aarch64-linux-android-ar rcsD bazel-out/android-arm64-v8a-opt/bin/external/com_google_mediapipe/mediapipe/graphs/object_detection_3d/calculators/libannotations_to_model_matrices_calculator_cc_proto.pic.lo bazel-out/android-arm64-v8a-opt/bin/external/com_google_mediapipe/mediapipe/graphs/object_detection_3d/calculators/_objs/annotations_to_model_matrices_calculator_cc_proto/annotations_to_model_matrices_calculator.pb.pic.o
Execution platform: @local_execution_config_platform//:platform
C:_bzl\b2b5753g\execroot\mediapipe_api\external\androidndk\ndk\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-ar: bazel-out/android-arm64-v8a-opt/bin/external/com_google_mediapipe/mediapipe/graphs/object_detection_3d/calculators/_objs/annotations_to_model_matrices_calculator_cc_proto/annotations_to_model_matrices_calculator.pb.pic.o: No such file or directory
Target //mediapipe_api/java/com/github/homuler/mediapipe:mediapipe_android failed to build
INFO: Elapsed time: 360.845s, Critical Path: 316.83s
INFO: 961 processes: 158 internal, 803 local.
FAILED: Build did NOT complete successfully
Traceback (most recent call last):
File "D:\MediaPipePlugin\build.py", line 451, in 
Argument().command().run()
File "D:\MediaPipePlugin\build.py", line 160, in run
self._run_command(self._build_android_commands())
File "D:\MediaPipePlugin\build.py", line 53, in _run_command
return subprocess.run(' '.join(command_list), check=True, shell=shell)
File "C:\Users\Capermint\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'bazel --output_user_root C:/_bzl build -c opt --action_env PYTHON_BIN_PATH="C://Users//Capermint//AppData//Local//Programs//Python//Python39//python.exe" --action_env ProgramData --action_env PROCESSOR_ARCHITECTURE --action_env PROCESSOR_IDENTIFIER --action_env PROCESSOR_LEVEL --action_env PROCESSOR_REVISION --verbose_failures --config=android_arm64 //mediapipe_api/java/com/github/homuler/mediapipe:mediapipe_android' returned non-zero exit status 1.
(env) D:\MediaPipePlugin>

Duplicate issue #607: issue when trying to build for android on win10: annotations_to_model_matrices_calculator.pb.pic.o: No such file or directory
Created: 2022-06-10T17:47:40Z
Plugin Version or Commit ID
v.0.10.0
Unity Version
2021.3.3f1
Your Host OS
Windows 10
Target Platform
Android
[Windows Only] Visual Studio C++ and Windows SDK Version
No response
[Linux Only] GCC/G++ and GLIBC Version
No response
[Android Only] Android Build Tools and NDK Version
build-tools: 30.0.3
ndk: 21.4.7075529
[iOS Only] XCode Version
No response
Command Sequences
python build.py build --android arm64 --android_ndk_api_level 21 -vv
Log
ERROR: C:/_bzl/ip3efmgv/external/com_google_mediapipe/mediapipe/graphs/object_detection_3d/calculators/BUILD:30:24: Linking external/com_google_mediapipe/mediapipe/graphs/object_detection_3d/calculators/libannotations_to_model_matrices_calculator_cc_proto.pic.lo failed: (Exit 1): aarch64-linux-android-ar failed: error executing command
cd C:/_bzl/ip3efmgv/execroot/mediapipe_api
SET ANDROID_NDK_API_LEVEL=21
SET PATH=C:\msys64\usr\bin;C:\msys64\bin;C:\WINDOWS;C:\WINDOWS\System32;C:\WINDOWS\System32\WindowsPowerShell\v1.0;Z:\global\Utils\Windows\Java\jdk-11.0.12\bin;Z:\global\Lib\android\android-sdk;Z:\global\Lib\android\android-sdk\ndk\21.4.7075529;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn;C:\Program Files\Git\cmd;C:\Program Files\Perforce\Server;C:\Program Files\Perforce;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\dotnet;C:\Users\TPU-U\AppData\Local\Microsoft\WindowsApps;C:\Users\TPU-U.dotnet\tools;C:\Python\Python39;C:\msys64;C:\msys64\usr\bin;C:\bazel;C:\nuget;C:\opencv;"C:\Program Files\Far Manager"
SET PROCESSOR_ARCHITECTURE=AMD64
SET PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
SET PROCESSOR_LEVEL=6
SET PROCESSOR_REVISION=9e0a
SET PWD=/proc/self/cwd
SET PYTHON_BIN_PATH=C://Python//Python39//python.exe
SET ProgramData=C:\ProgramData
SET RUNFILES_MANIFEST_ONLY=1
external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/bin/aarch64-linux-android-ar rcsD bazel-out/android-arm64-v8a-opt/bin/external/com_google_mediapipe/mediapipe/graphs/object_detection_3d/calculators/libannotations_to_model_matrices_calculator_cc_proto.pic.lo bazel-out/android-arm64-v8a-opt/bin/external/com_google_mediapipe/mediapipe/graphs/object_detection_3d/calculators/_objs/annotations_to_model_matrices_calculator_cc_proto/annotations_to_model_matrices_calculator.pb.pic.o
Execution platform: @local_execution_config_platform//:platform
C:_bzl\ip3efmgv\execroot\mediapipe_api\external\androidndk\ndk\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-ar: bazel-out/android-arm64-v8a-opt/bin/external/com_google_mediapipe/mediapipe/graphs/object_detection_3d/calculators/_objs/annotations_to_model_matrices_calculator_cc_proto/annotations_to_model_matrices_calculator.pb.pic.o: No such file or directory
Target //mediapipe_api/java/com/github/homuler/mediapipe:mediapipe_android failed to build
INFO: Elapsed time: 817.237s, Critical Path: 177.24s
INFO: 4223 processes: 655 internal, 3559 local, 9 worker.
Additional Context

Closing comment (2022-06-11T01:50:30Z): See https://github.com/homuler/MediaPipeUnityPlugin/wiki/Installation-Guide#windows-10.


⚠️ You cannot build libraries for Android with the following steps.
If you use Window 10 Pro, go to Docker Windows Container. Otherwise, go to Docker Linux Container.


If you really want to build AAR on Windows 10, see Dockerfile and https://github.com/homuler/MediaPipeUnityPlugin/wiki/Installation-Guide#docker-windows-container.
duplicates #387.