Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Andorid Library Failed-Connect timed out #536

Closed
HakuWang opened this issue Apr 18, 2022 · 11 comments
Closed

Build Andorid Library Failed-Connect timed out #536

HakuWang opened this issue Apr 18, 2022 · 11 comments
Labels
type:build/install Cannot build/install the plugin

Comments

@HakuWang
Copy link

Plugin Version or Commit ID

v0.8.3

Unity Version

2020.3.30f1

Your Host OS

Windows 10

Target Platform

Android

[Windows Only] Visual Studio C++ and Windows SDK Version

VisualStudio C++: 14.29.30133
Windows SDK: 10.0.19041.0

[Linux Only] GCC/G++ and GLIBC Version

No response

[Android Only] Android Build Tools and NDK Version

Build Tools: 30.0.2
NDK:19.0.5232133

[iOS Only] XCode Version

No response

Command Sequences

docker build -t mediapipe_unity:linux . -f docker/linux/x86_64/Dockerfile

docker run --cpus=6 --memory=16g --mount type=bind,src=E:\SVN\YZDH\VideoBasedFacialAnim\MediaPipeUnityPluginDocker\Packages,dst=/home/mediapipe/Packages --mount type=bind,src=E:\SVN\YZDH\VideoBasedFacialAnim\MediaPipeUnityPluginDocker\Assets,dst=/home/mediapipe/Assets -it mediapipe_unity:linux

python build.py build --android arm64 -vv

Log

INFO (build.py): Building protobuf sources...
DEBUG (build.py): Running bazel build -c opt --verbose_failures //mediapipe_api:mediapipe_proto_srcs
2022/04/18 02:08:02 Downloading https://releases.bazel.build/4.2.1/release/bazel-4.2.1-linux-x86_64...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
WARNING: Download from https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz failed: class java.io.IOException connect timed out
INFO: Repository build_bazel_rules_apple instantiated at:
/home/mediapipe/WORKSPACE:341:13: in
Repository rule http_archive defined at:
/home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in
WARNING: Download from https://github.com/bazelbuild/rules_apple/releases/download/0.32.0/rules_apple.0.32.0.tar.gz failed: class java.io.IOException connect timed out
ERROR: An error occurred during the fetch of repository 'build_bazel_rules_apple':
Traceback (most recent call last):
File "/home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_apple/releases/download/0.32.0/rules_apple.0.32.0.tar.gz] to /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/build_bazel_rules_apple/temp7019480873336431819/rules_apple.0.32.0.tar.gz: connect timed out
ERROR: Error fetching repository: Traceback (most recent call last):
File "/home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_apple/releases/download/0.32.0/rules_apple.0.32.0.tar.gz] to /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/build_bazel_rules_apple/temp7019480873336431819/rules_apple.0.32.0.tar.gz: connect timed out
ERROR: no such package '@build_bazel_rules_apple//apple': java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_apple/releases/download/0.32.0/rules_apple.0.32.0.tar.gz] to /home/mediapipe/.cache/bazel/_bazel_mediapipe/6c11c387a04fa8f17c87a5c6db6ee555/external/build_bazel_rules_apple/temp7019480873336431819/rules_apple.0.32.0.tar.gz: connect timed out
INFO: Elapsed time: 406.781s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
Traceback (most recent call last):
File "/home/mediapipe/build.py", line 448, in
Argument().command().run()
File "/home/mediapipe/build.py", line 114, in run
self._run_command(self._build_proto_srcs_commands())
File "/home/mediapipe/build.py", line 54, in _run_command
return subprocess.run(' '.join(command_list), check=True, shell=shell)
File "/usr/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'bazel build -c opt --verbose_failures //mediapipe_api:mediapipe_proto_srcs' returned non-zero exit status 1.

Additional Context

i built successfully by [Docker Windows Container] last month, but i skipped the step 5 during the building.

now i want to build an android apk. My understanding is that i need to build android library first, then i can build the apk by unity editor like normal unity games. Is my understanding correct?

i followed the instructions in https://github.com/homuler/MediaPipeUnityPlugin/wiki/Installation-Guide#docker-linux-container to build android library and got errors in the log. It seems like something about network, but i am not sure. i'd appreciate it if you could help me.

@HakuWang HakuWang added the type:build/install Cannot build/install the plugin label Apr 18, 2022
@homuler
Copy link
Owner

homuler commented Apr 18, 2022

now i want to build an android apk. My understanding is that i need to build android library first, then i can build the apk by unity editor like normal unity games. Is my understanding correct?

Yes.

It seems like something about network, but i am not sure.

I think it's a network issue, too.

I've just merged #537, which allows arbitrary options to be passed to Bazel.
With this change, we can change the timeout configuration (cf. https://docs.bazel.build/versions/main/command-line-reference.html#flag--experimental_scale_timeouts).

python build.py build --bazel_build_opts "--experimental_scale_timeouts=10.0 --http_timeout_scaling=10.0" --android arm64 -vv

I hope these options will mitigate your issue (note that you need to rebuild the Docker image to copy this new build.py).

@HakuWang
Copy link
Author

HakuWang commented Apr 19, 2022

Thank you for your help.

I tried to reinstall my docker desktop and rebuild the Docker image with the same build command before got your reply. But i got errors below:

docker build -t mediapipe_unity:linux . -f docker/linux/x86_64/Dockerfile
[+] Building 4423.0s (7/31)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 3.41kB 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/archlinux:latest 13.4s
=> [base 1/11] FROM docker.io/library/archlinux:latest@sha256:4d421ae2256a9e607d7937b7f015e19111a28d0bd87d35 2823.0s
=> => resolve docker.io/library/archlinux:latest@sha256:4d421ae2256a9e607d7937b7f015e19111a28d0bd87d35ad82ce6273 0.0s
=> => sha256:4d421ae2256a9e607d7937b7f015e19111a28d0bd87d35ad82ce627378bb82d1 319B / 319B 0.0s
=> => sha256:e8c25aa13561860e0c1db247ebe467c38656780098254babca96db18e4ecfabb 738B / 738B 0.0s
=> => sha256:a6bef8b30552cb141c2aba0818baa37968fae3b2adecdd38ed61c91d1333de21 1.80kB / 1.80kB 0.0s
=> => sha256:7a9cb3f80328f40bd6cb9c4977ae7698f7081ce5245cd33ab1605399fb97f1ad 133.55MB / 133.55MB 2817.6s
=> => sha256:a21ffec679eb0717b49f896335fc09bfd864e4fa32122f683b6b49bad64fc823 7.07kB / 7.07kB 2.6s
=> => extracting sha256:7a9cb3f80328f40bd6cb9c4977ae7698f7081ce5245cd33ab1605399fb97f1ad 5.0s
=> => extracting sha256:a21ffec679eb0717b49f896335fc09bfd864e4fa32122f683b6b49bad64fc823 0.0s
=> [internal] load build context 0.2s
=> => transferring context: 365.65kB 0.2s
=> [base 2/11] RUN if [[ "${RANKMIRROS}" ]]; then pacman -Syu pacman-contrib --needed --noconfirm && 0.3s
=> ERROR [base 3/11] RUN pacman -Sy archlinux-keyring --noconfirm && pacman -Syuu sudo --needed --noconfirm 1586.1s

[base 3/11] RUN pacman -Sy archlinux-keyring --noconfirm && pacman -Syuu sudo --needed --noconfirm:
#6 0.259 :: Synchronizing package databases...
#6 613.7 core downloading...
#6 613.7 extra downloading...
#6 613.7 community downloading...
#6 613.7 error: failed retrieving file 'extra.db' from mirror.pkgbuild.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#6 613.7 resolving dependencies...
#6 613.7 looking for conflicting packages...
#6 613.7 warning: archlinux-keyring-20220224-1 is up to date -- reinstalling
#6 613.7
#6 613.7 Package (1) Old Version New Version Net Change Download Size
#6 613.7
#6 613.7 core/archlinux-keyring 20220224-1 20220224-1 0.00 MiB 1.02 MiB
#6 613.7
#6 613.7 Total Download Size: 1.02 MiB
#6 613.7 Total Installed Size: 1.44 MiB
#6 613.7 Net Upgrade Size: 0.00 MiB
#6 613.7
#6 613.7 :: Proceed with installation? [Y/n]
#6 613.7 :: Retrieving packages...
#6 693.9 archlinux-keyring-20220224-1-any downloading...
#6 693.9 checking keyring...
#6 693.9 checking package integrity...
#6 693.9 loading package files...
#6 693.9 checking for file conflicts...
#6 694.0 :: Processing package changes...
#6 694.0 reinstalling archlinux-keyring...
#6 694.0 ==> ERROR: There is no secret key available to sign with.
#6 694.0 ==> Use 'pacman-key --init' to generate a default secret key.
#6 694.0 ==> Updating trust database...
#6 694.0 gpg: next trustdb check due at 2022-05-06
#6 694.1 :: Running post-transaction hooks...
#6 694.1 (1/1) Arming ConditionNeedsUpdate...
#6 694.1 :: Synchronizing package databases...
#6 697.3 core downloading...
#6 697.3 extra downloading...
#6 697.3 community downloading...
#6 697.3 :: Starting full system upgrade...
#6 697.4 resolving dependencies...
#6 697.4 looking for conflicting packages...
#6 697.4
#6 697.4 Package (9) Old Version New Version Net Change Download Size
#6 697.4
#6 697.4 core/iana-etc 20220205-1 20220325-1 0.00 MiB 0.38 MiB
#6 697.4 core/icu 70.1-1 71.1-1 0.98 MiB 10.85 MiB
#6 697.4 core/iproute2 5.17.0-1 5.17.0-2 0.00 MiB 1.05 MiB
#6 697.4 core/libbpf 0.7.0-1 0.68 MiB 0.22 MiB
#6 697.4 core/libmnl 1.0.4-3 1.0.5-1 0.00 MiB 0.01 MiB
#6 697.4 core/libnfnetlink 1.0.1-4 1.0.2-1 0.00 MiB 0.02 MiB
#6 697.4 core/libxml2 2.9.13-1 2.9.13-2 0.00 MiB 1.33 MiB
#6 697.4 core/pacman-mirrorlist 20220227-1 20220410-1 0.00 MiB 0.01 MiB
#6 697.4 core/sudo 1.9.10-1 6.85 MiB 1.65 MiB
#6 697.4
#6 697.4 Total Download Size: 15.51 MiB
#6 697.4 Total Installed Size: 63.37 MiB
#6 697.4 Net Upgrade Size: 8.51 MiB
#6 697.4
#6 697.4 :: Proceed with installation? [Y/n]
#6 697.4 :: Retrieving packages...
#6 1586.1 error: failed retrieving file 'sudo-1.9.10-1-x86_64.pkg.tar.zst' from mirror.pkgbuild.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#6 1586.1 error: failed retrieving file 'libxml2-2.9.13-2-x86_64.pkg.tar.zst' from mirror.pkgbuild.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#6 1586.1 error: failed retrieving file 'iproute2-5.17.0-2-x86_64.pkg.tar.zst' from mirror.pkgbuild.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#6 1586.1 warning: too many errors from mirror.pkgbuild.com, skipping for the remainder of this transaction
#6 1586.1 error: failed retrieving file 'iana-etc-20220325-1-any.pkg.tar.zst' from mirror.pkgbuild.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#6 1586.1 error: failed retrieving file 'libxml2-2.9.13-2-x86_64.pkg.tar.zst.sig' from mirror.rackspace.com : Operation too slow. Less than 1 byte[+] Building 4994.5s (12/31)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/archlinux:latest 9.1s
=> [base 1/11] FROM docker.io/library/archlinux:latest@sha256:4d421ae2256a9e607d7937b7f015e19111a28d0bd87d35ad82ce627378bb82d1 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 8.12kB 0.0s
=> CACHED [base 2/11] RUN if [[ "${RANKMIRROS}" ]]; then pacman -Syu pacman-contrib --needed --noconfirm && { 0.0s
=> [base 3/11] RUN pacman -Sy archlinux-keyring --noconfirm && pacman -Syuu sudo --needed --noconfirm 1547.3s
=> [base 4/11] RUN echo -e "%wheel ALL=(ALL) NOPASSWD: ALL\n" > /etc/sudoers.d/01_wheel 0.3s
=> [base 5/11] RUN sed -r -i 's/^UID_MAX\s*[0-9]+/UID_MAX\t\t\t60513/' /etc/login.defs && sed -r -i 's/^GID_MAX\s*[0-9]+/GID_MAX\t\t\ 0.3s
=> [base 6/11] RUN useradd -u 1000 -m mediapipe && usermod -aG wheel mediapipe 0.4s
=> [base 7/11] WORKDIR /home/mediapipe 0.1s
=> ERROR [base 8/11] RUN sudo pacman -Sy base-devel git glibc jdk11-openjdk unzip zip --needed --noconfirm 3437.1s


[base 8/11] RUN sudo pacman -Sy base-devel git glibc jdk11-openjdk unzip zip --needed --noconfirm:
#11 0.194 :: Synchronizing package databases...
#11 498.0 core downloading...
#11 498.0 extra downloading...
#11 498.0 community downloading...
#11 498.2 warning: file-5.41-1 is up to date -- skipping
#11 498.2 warning: findutils-4.9.0-1 is up to date -- skipping
#11 498.2 warning: gawk-5.1.1-1 is up to date -- skipping
#11 498.2 warning: gettext-0.21-2 is up to date -- skipping pacman -Syu pacman-contrib --needed --noconfirm && { 0.0s
#11 498.2 warning: grep-3.7-1 is up to date -- skippingonfirm && pacman -Syuu sudo --needed --noconfirm 108.3s
#11 498.2 warning: gzip-1.12-1 is up to date -- skipping
#11 498.2 warning: pacman-6.0.1-4 is up to date -- skipping
#11 498.2 warning: sed-4.8-1 is up to date -- skipping
#11 498.2 warning: sudo-1.9.10-1 is up to date -- skipping
#11 498.2 :: There are 15 members in group base-devel:
#11 498.2 :: Repository core
#11 498.2 1) autoconf 2) automake 3) binutils 4) bison 5) fakeroot 6) flex 7) gcc 8) groff 9) libtool 10) m4 11) make 12) patch 13) pkgconf 14) texinfo 15) which
#11 498.2
#11 498.2 Enter a selection (default=all):
#11 498.2 resolving dependencies...
#11 498.2 warning: glibc-2.35-3 is up to date -- skipping
#11 498.2 looking for conflicting packages...
#11 498.2 warning: dependency cycle detected:
#11 498.2 warning: harfbuzz will be installed before its freetype2 dependency
#11 498.2
#11 498.2 Package (46) New Version Net Change Download Size
#11 498.2
#11 498.2 core/db 5.3.28-5 6.41 MiB 1.07 MiB
#11 498.2 core/diffutils 3.8-1 1.47 MiB 0.35 MiB
#11 498.2 extra/freetype2 2.12.0-1 1.63 MiB 0.49 MiB
#11 498.2 core/gc 8.2.0-3 0.75 MiB 0.23 MiB
#11 498.2 core/gdbm 1.23-1 0.77 MiB 0.26 MiB
#11 498.2 extra/giflib 5.2.1-2 0.30 MiB 0.07 MiB
#11 498.2 extra/graphite 1:1.3.14-1 0.67 MiB 0.22 MiB
#11 498.2 core/guile 2.2.7-2 44.10 MiB 6.32 MiB
#11 498.2 extra/harfbuzz 4.2.0-3 5.80 MiB 0.95 MiB
#11 498.2 extra/hicolor-icon-theme 0.17-2 0.05 MiB 0.01 MiB
#11 498.2 extra/java-environment-common 3-3 0.00 MiB 0.00 MiB
#11 498.2 extra/java-runtime-common 3-3 0.01 MiB 0.00 MiB
#11 498.2 extra/jre11-openjdk 11.0.15.u3-1 0.53 MiB 0.19 MiB
#11 498.2 extra/jre11-openjdk-headless 11.0.15.u3-1 158.74 MiB 35.63 MiB
#11 498.2 extra/lcms2 2.13.1-1 0.65 MiB 0.21 MiB
#11 498.2 core/libisl 0.24-4 9.56 MiB 1.48 MiB
#11 498.2 extra/libjpeg-turbo 2.1.3-1 1.87 MiB 0.44 MiB
#11 498.2 core/libmpc 1.2.1-2 0.14 MiB 0.07 MiB
#11 498.2 extra/libnet 1:1.1.6-1 0.30 MiB 0.09 MiB
#11 498.2 extra/libpng 1.6.37-3 0.55 MiB 0.24 MiB
#11 498.2 extra/libtiff 4.3.0-2 2.80 MiB 0.84 MiB
#11 498.2 core/nspr 4.33-2 0.72 MiB 0.19 MiB
#11 498.2 core/nss 3.77-1 4.86 MiB 1.52 MiB
#11 498.2 core/perl 5.34.1-1 58.85 MiB 15.37 MiB
#11 498.2 extra/perl-error 0.17029-3 0.04 MiB 0.02 MiB
#11 498.2 extra/perl-mailtools 2.21-5 0.11 MiB 0.06 MiB
#11 498.2 extra/perl-timedate 2.33-3 0.08 MiB 0.03 MiB
#11 498.2 core/autoconf 2.71-1 2.20 MiB 0.63 MiB
#11 498.2 core/automake 1.16.5-1 1.57 MiB 0.60 MiB
#11 498.2 core/binutils 2.38-4 30.91 MiB 6.08 MiB
#11 498.2 core/bison 3.8.2-3 2.53 MiB 0.75 MiB
#11 498.2 core/fakeroot 1.28-1 0.13 MiB 0.07 MiB
#11 498.2 core/flex 2.6.4-3 0.95 MiB 0.29 MiB
#11 498.2 core/gcc 11.2.0-4 137.58 MiB 33.23 MiB
#11 498.2 extra/git 2.35.3-1 33.32 MiB 5.98 MiB
#11 498.2 core/groff 1.22.4-7 9.31 MiB 2.16 MiB
#11 498.2 extra/jdk11-openjdk 11.0.15.u3-1 88.11 MiB 76.93 MiB
#11 498.2 core/libtool 2.4.7-1 2.22 MiB 0.40 MiB
#11 498.2 core/m4 1.4.19-1 0.49 MiB 0.25 MiB
#11 498.2 core/make 4.3-3 1.52 MiB 0.47 MiB
#11 498.2 core/patch 2.7.6-8 0.19 MiB 0.09 MiB
#11 498.2 core/pkgconf 1.8.0-1 0.16 MiB 0.06 MiB
#11 498.2 core/texinfo 6.8-2 8.75 MiB 1.39 MiB
#11 498.2 extra/unzip 6.0-18 0.30 MiB 0.14 MiB
#11 498.2 core/which 2.21-5 0.03 MiB 0.02 MiB
#11 498.2 extra/zip 3.0-10 0.53 MiB 0.16 MiB
#11 498.2
#11 498.2 Total Download Size: 196.03 MiB
#11 498.2 Total Installed Size: 622.56 MiB
#11 498.2
#11 498.2 :: Proceed with installation? [Y/n]
#11 498.2 :: Retrieving packages...
#11 3437.0 error: failed retrieving file 'jre11-openjdk-headless-11.0.15.u3-1-x86_64.pkg.tar.zst' from mirror.pkgbuild.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#11 3437.0 error: failed retrieving file 'gcc-11.2.0-4-x86_64.pkg.tar.zst' from mirror.pkgbuild.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#11 3437.0 error: failed retrieving file 'perl-5.34.1-1-x86_64.pkg.tar.zst' from mirror.pkgbuild.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#11 3437.0 warning: too many errors from mirror.pkgbuild.com, skipping for the remainder of this transaction
#11 3437.0 error: failed retrieving file 'guile-2.2.7-2-x86_64.pkg.tar.zst' from mirror.pkgbuild.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#11 3437.0 error: failed retrieving file 'binutils-2.38-4-x86_64.pkg.tar.zst' from mirror.rackspace.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#11 3437.0 error: failed retrieving file 'binutils-2.38-4-x86_64.pkg.tar.zst' from mirror.leaseweb.net : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#11 3437.0 error: failed retrieving file 'jdk11-openjdk-11.0.15.u3-1-x86_64.pkg.tar.zst' from mirror.pkgbuild.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#11 3437.0 error: failed retrieving file 'jdk11-openjdk-11.0.15.u3-1-x86_64.pkg.tar.zst' from mirror.rackspace.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#11 3437.0 error: failed retrieving file 'jre11-openjdk-headless-11.0.15.u3-1-x86_64.pkg.tar.zst.sig' from mirror.rackspace.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#11 3437.0 warning: too many errors from mirror.rackspace.com, skipping for the remainder of this transaction
#11 3437.0 error: failed retrieving file 'jdk11-openjdk-11.0.15.u3-1-x86_64.pkg.tar.zst' from mirror.leaseweb.net : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds
#11 3437.0 warning: failed to retrieve some files
#11 3437.0 jdk11-openjdk-11.0.15.u3-1-x86_64 downloading...
#11 3437.0 jre11-openjdk-headless-11.0.15.u3-1-x86_64 downloading...
#11 3437.0 gcc-11.2.0-4-x86_64 downloading...
#11 3437.0 perl-5.34.1-1-x86_64 downloading...
#11 3437.0 guile-2.2.7-2-x86_64 downloading...
#11 3437.0 binutils-2.38-4-x86_64 downloading...
#11 3437.0 error: failed to commit transaction (download library error)
#11 3437.1 Errors occurred, no packages were upgraded.


executor failed running [/bin/sh -c sudo pacman -Sy base-devel git glibc jdk11-openjdk unzip zip --needed --noconfirm]: exit code: 1

@homuler
Copy link
Owner

homuler commented Apr 19, 2022

You should specify MIRROR_COUNTRY (cf. https://github.com/homuler/MediaPipeUnityPlugin/wiki/Installation-Guide#docker).
See also https://wiki.archlinux.org/title/mirrors#Fetching_and_ranking_a_live_mirror_list.

P.S.

I tried to reinstall my docker desktop

I don't know why you had to reinstall Docker Desktop, but it should have cleared your local cached layers.
Usually, it doesn't take a long time to rebuild a Docker image.

@homuler homuler added the stat:awaiting response Awaiting response from author label Apr 21, 2022
@HakuWang
Copy link
Author

HakuWang commented Apr 22, 2022

Thanks a lot.

I tried many times and strived to improve internet speed. I also replaced the build.py with the #537 version, and used the build command you provided. I don't know exactly which modification made the difference. Anyway now i built android library successfully and built an apk with unity editor.

By the way, i met the DllNotFoundException problem on my older device. On another android device, the apk can run except that the displayed image is y-flipped. I used the command "adb shell getprop ro.build.version.sdk" to check api level for my older android device and got "26". I checked the TroubleShooting part on wiki and now I'm tring to rebuild the android library with option "--android_ndk_api_level 21". Is this the right way to solve this problem ?

@homuler
Copy link
Owner

homuler commented Apr 22, 2022

I checked the TroubleShooting part on wiki and now I'm tring to rebuild the android library with option "--android_ndk_api_level 21". Is this the right way to solve this problem ?

Maybe, but it depends on the cause.
If some symbols are missing, specifying --android_ndk_api_level will resolve the issue.
For example, I guess your device does not support aligned_alloc, which is introduced at API level 28 (cf. https://android.googlesource.com/platform/bionic/+/master/docs/status.md).

On the other hand, if the CPU of your device is armv7, you may want to build libraries with the --android fat option.
See also #171 (comment).

On another android device, the apk can run except that the displayed image is y-flipped.

I hope this issue is already fixed by #504 (included in v0.8.4).

@homuler homuler removed the stat:awaiting response Awaiting response from author label Apr 22, 2022
@HakuWang
Copy link
Author

HakuWang commented Apr 22, 2022

On the other hand, if the CPU of your device is armv7, you may want to build libraries with the --android fat option.
i also checked cpu, my device is arm64.

For example, I guess your device does not support aligned_alloc, which is introduced at API level 28 (cf. https://android.googlesource.com/platform/bionic/+/master/docs/status.md).

Yes, this is my situation. But after rebuilt the android library specifying --android_ndk_api_level, my older device still got the same problem. I have tried ndk api level with 26, 21 and 19.

here is my logs from monitor:

04-22 16:18:15.177: E/Unity(19456): AndroidJavaException: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "aligned_alloc" referenced by "/data/app/com.uz.mediapipe-tK8jkDZtVsdrHfrQVx2y8w==/lib/arm64/libmediapipe_jni.so"...
04-22 16:18:15.177: E/Unity(19456): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "aligned_alloc" referenced by "/data/app/com.uz.mediapipe-tK8jkDZtVsdrHfrQVx2y8w==/lib/arm64/libmediapipe_jni.so"...
04-22 16:18:15.177: E/Unity(19456):      at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
04-22 16:18:15.177: E/Unity(19456):      at java.lang.System.loadLibrary(System.java:1660)
04-22 16:18:15.177: E/Unity(19456):      at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
04-22 16:18:15.177: E/Unity(19456):      at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
04-22 16:18:15.177: E/Unity(19456):      at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
04-22 16:18:15.177: E/Unity(19456):      at android.os.Handler.dispatchMessage(Handler.java:104)
04-22 16:18:15.177: E/Unity(19456):      at android.os.Looper.loop(Looper.java:166)
04-22 16:18:15.177: E/Unity(19456):      at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
04-22 16:18:15.177: E/Unity(19456):   at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0
04-22 16:18:15.177: E/Unity(19456):   at UnityEngine.AndroidJNISafe.CallStaticVoidMethod (System.IntP

04-22 16:18:15.315: D/Unity(19456): Failed to load native plugin: Unable to load library '/data/app/com.uz.mediapipe-tK8jkDZtVsdrHfrQVx2y8w==/lib/arm64/libmediapipe_jni.so', error 'java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "aligned_alloc" referenced by "/data/app/com.uz.mediapipe-tK8jkDZtVsdrHfrQVx2y8w==/lib/arm64/libmediapipe_jni.so"...'
04-22 16:18:15.400: E/Unity(19456): DllNotFoundException: Unable to load DLL 'mediapipe_jni': The specified module could not be found.
04-22 16:18:15.400: E/Unity(19456):   at Mediapipe.Glog.set_Logtostderr (System.Boolean value) [0x00000] in <00000000000000000000000000000000>:0
04-22 16:18:15.400: E/Unity(19456):   at Mediapipe.Unity.GlobalConfigManager.SetFlags () [0x00000] in <00000000000000000000000000000000>:0
04-22 16:18:15.400: E/Unity(19456):   at Mediapipe.Unity.Bootstrap+<Start>d__17.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
04-22 16:18:15.400: E/Unity(19456):   at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0

@homuler
Copy link
Owner

homuler commented Apr 22, 2022

I see.
As mentioned in the Build / Install issue form, when you have trouble with building libraries, please download the latest version (v0.9.1 at the moment).
The Installation Guide is written for the latest version, so the methods described in it do not necessarily work for older versions.

I also replaced the build.py with the #537 version,

Maybe you just downloaded build.py and didn't pull the commit, did you?
v0.8.3 does not contain changes to make --android_ndk_api_level option work.

@HakuWang
Copy link
Author

HakuWang commented Apr 22, 2022

Maybe you just downloaded build.py and didn't pull the commit, did you?

I didn't pull the whole commit.

If i could make --android_ndk_api_level option work, which level should i specified ? 26(same as my device) or 19 (same as unity used during building) ?

Thank you for your help.

@homuler
Copy link
Owner

homuler commented Apr 22, 2022

I think 21 will do.
At v0.8.3, you need to modify WORKSPACE file to specify api_level (cf. #270).

You can check if you have built mediapipe_android.aar correctly as follows:

unzip mediapipe_android.aar
objdump -T jni/arm64-v8a/libmediapipe_jni.so | grep aligned_malloc

@HakuWang
Copy link
Author

I think 21 will do.
At v0.8.3, you need to modify WORKSPACE file to specify api_level (cf. #270).

Yes, I modified WORKSPACE file, rebuilt the image and rebuilt mediapipe_android.aar as you said. Now it works on my device.
Thank you so much !

@homuler homuler closed this as completed Apr 23, 2022
@9276
Copy link

9276 commented May 7, 2022

i want to how use MediaPipeUnityPlugin in android。can you tell me step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:build/install Cannot build/install the plugin
Projects
None yet
Development

No branches or pull requests

3 participants