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

ver 0.8.3.2 run setup_android_examples.sh failed! #1822

Closed
lilinxiong opened this issue Mar 31, 2021 · 7 comments
Closed

ver 0.8.3.2 run setup_android_examples.sh failed! #1822

lilinxiong opened this issue Mar 31, 2021 · 7 comments
Assignees
Labels
platform:android Issues with Android as Platform type:build/install For Build and Installation issues

Comments

@lilinxiong
Copy link

OS: MacOS 11.2.3

workspace:
MediaPipe version:

0.8.3.2

clang -version

Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

bazel verison

 Build label: 3.7.2
 Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
 Build time: Thu Dec 17 17:02:20 2020 (1608224540)
 Build timestamp: 1608224540
 Build timestamp as int: 1608224540

java -version

java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)

Execution order:

  1. instructions
    output:
...
INFO: Elapsed time: 76.780s, Critical Path: 67.57s
INFO: 409 processes: 2 internal, 407 darwin-sandbox.
INFO: Build completed successfully, 409 total actions
INFO: Build completed successfully, 409 total actions
I20210331 15:16:51.669309 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670514 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670562 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670596 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670634 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670663 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670693 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670722 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670758 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670791 319131136 hello_world.cc:56] Hello World!

I think MediaPipe install successful !
2. setup Android SDK and NDK !

sh setup_android_sdk_and_ndk.sh ../Android/Sdk ../Android/Sdk/ndk-bundle r18b
  1. build all MediaPipe Android example apps !
sh build_android_examples.sh

print:

app_dir: mediapipe/examples/android/src/java/com/google/mediapipe/apps
out_dir: .
strip: true
Switching to OpenCV 3
=== Target: mediapipe/examples/android/src/java/com/google/mediapipe/apps/basic:helloworld
DEBUG: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'rules_cc' because it already exists.
DEBUG: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'bazel_skylib' because it already exists.
DEBUG: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'pybind11' because it already exists.
INFO: Build options --compilation_mode, --cpu, --crosstool_top, and 3 more have changed, discarding analysis cache.
INFO: Analyzed target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/basic:helloworld (94 packages loaded, 6634 targets configured).
INFO: Found 1 target...
INFO: From Generating JavaLite proto_library //mediapipe/framework:mediapipe_options_proto:
[libprotobuf WARNING external/com_google_protobuf/src/google/protobuf/compiler/java/java_file.cc:230] mediapipe/framework/mediapipe_options.proto: The file's outer class name, "MediapipeOptions", matches the name of one of the types declared inside it when case is ignored. This can cause compilation issues on Windows / MacOS. Please either rename the type or use the java_outer_classname option to specify a different outer class name for the .proto file to be safe.
INFO: From ProtoCompile mediapipe/gpu/gl_surface_sink_calculator.pb.h:
bazel-out/android-arm64-v8a-opt/bin/external/com_google_protobuf/src: warning: directory does not exist.
INFO: From ProtoCompile mediapipe/framework/calculator_profile.pb.h:
bazel-out/android-arm64-v8a-opt/bin/external/com_google_protobuf/src: warning: directory does not exist.
INFO: From ProtoCompile mediapipe/framework/calculator.pb.h:
bazel-out/android-arm64-v8a-opt/bin/external/com_google_protobuf/src: warning: directory does not exist.
INFO: From ProtoCompile mediapipe/gpu/gl_context_options.pb.h:
bazel-out/android-arm64-v8a-opt/bin/external/com_google_protobuf/src: warning: directory does not exist.
INFO: From ProtoCompile mediapipe/calculators/internal/callback_packet_calculator.pb.h:
bazel-out/android-arm64-v8a-opt/bin/external/com_google_protobuf/src: warning: directory does not exist.
INFO: From ProtoCompile mediapipe/framework/tool/calculator_graph_template.pb.h:
bazel-out/android-arm64-v8a-opt/bin/external/com_google_protobuf/src: warning: directory does not exist.
INFO: From ProtoCompile mediapipe/framework/calculator.pb.h [for host]:
bazel-out/host/bin/external/com_google_protobuf/src: warning: directory does not exist.
ERROR: /private/var/tmp/_bazel_lilinxiong/2bf286f5038854ea76b20bfe4c279064/external/bazel_tools/tools/jdk/BUILD:350:14: Action external/bazel_tools/tools/jdk/platformclasspath.jar failed (Exit 1): java failed: error executing command external/remotejdk11_macos/bin/java -XX:+IgnoreUnrecognizedVMOptions '--add-exports=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED' -cp ... (remaining 4 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox java failed: error executing command external/remotejdk11_macos/bin/java -XX:+IgnoreUnrecognizedVMOptions '--add-exports=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED' -cp ... (remaining 4 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
Exception in thread "main" java.lang.IllegalArgumentException: external/local_jdk
at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.update(Locations.java:1853)
at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.handleOption(Locations.java:1798)
at jdk.compiler/com.sun.tools.javac.file.Locations.handleOption(Locations.java:2062)
at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(BaseFileManager.java:269)
at jdk.compiler/com.sun.tools.javac.file.BaseFileManager$2.handleFileManagerOption(BaseFileManager.java:222)
at jdk.compiler/com.sun.tools.javac.main.Option.process(Option.java:1138)
at jdk.compiler/com.sun.tools.javac.main.Option.handleOption(Option.java:1086)
at jdk.compiler/com.sun.tools.javac.file.BaseFileManager.handleOption(BaseFileManager.java:232)
at jdk.compiler/com.sun.tools.javac.main.Arguments.doProcessArgs(Arguments.java:390)
at jdk.compiler/com.sun.tools.javac.main.Arguments.processArgs(Arguments.java:347)
at jdk.compiler/com.sun.tools.javac.main.Arguments.init(Arguments.java:246)
at jdk.compiler/com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:185)
at DumpPlatformClassPath.dumpJDK9AndNewerBootClassPath(DumpPlatformClassPath.java:106)
at DumpPlatformClassPath.main(DumpPlatformClassPath.java:67)
Target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/basic:helloworld failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 39.112s, Critical Path: 30.83s
INFO: 309 processes: 126 internal, 177 darwin-sandbox, 6 worker.
FAILED: Build did NOT complete successfully

I see #1679 (comment). But I build MediaPipe Version 0.8.3.2…
I don't know what I did wrong

Looking forward to reply!!!

@lilinxiong
Copy link
Author

sorry ! I forget provide python workspace.
I use miniconda create python workspace.
step:

conda create --name py374_wp python=3.7.4
pip3 install --user six
...

others are consistent with the documentation.
Looking forward to reply!!!

@sgowroji sgowroji self-assigned this Mar 31, 2021
@sgowroji sgowroji added platform:android Issues with Android as Platform type:build/install For Build and Installation issues labels Mar 31, 2021
@sgowroji
Copy link

Hi @lilinxiong Assuming you have a similar issue #68

@lilinxiong
Copy link
Author

@sgowroji My JDK is from https://www.oracle.com/cn/java/technologies/javase/javase-jdk8-downloads.html. and
java -version

java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)

so I don't think My JDK was corrupted.
build MediaPipe need specific version JDK?

@sgowroji sgowroji assigned eknight7 and unassigned sgowroji Mar 31, 2021
@eknight7 eknight7 assigned jiuqiant and unassigned eknight7 Mar 31, 2021
@eknight7
Copy link

Re-assigning to @jiuqiant since he is more familiar with platform specific build requirements.

@jiuqiant
Copy link
Contributor

jiuqiant commented Apr 1, 2021

Seems to be a bazel issue similiar to bazelbuild/bazel#7304. Can you try the solutions mentioned in bazelbuild/bazel#7304 (comment)?

@lilinxiong
Copy link
Author

Thank you very much for your reply ! @sgowroji @eknight7 @jiuqiant .
I think my problem is solved. As @jiuqiant say. is bazel problem.
But I find no install openjdk@11 can also work !
My workspace and all build step is:

OS: MacOS 11.2.3
MediaPipe version: 0.8.3.2
clang -version

Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

bazel verison

 Build label: 3.7.2
 Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
 Build time: Thu Dec 17 17:02:20 2020 (1608224540)
 Build timestamp: 1608224540
 Build timestamp as int: 1608224540

note: No JDK, No OpenJDK
If proxy is set, need set environment variables:

export HTTPS_PROXY=http://127.0.0.1:7890 HTTP_PROXY=http://127.0.0.1:7890 ALL_PROXY=socks5://127.0.0.1:7890

IP and PORT set as own.
Execution order:

  1. instructions
    Here I am use miniconda create python3.7.4
conda create --name py374_wp python=3.7.4
conda activate py374_wp
pip ​install six

But I find in the process bazel run --define MEDIAPIPE_DISABLE_GPU=1
​mediapipe/examples/desktop/hello_world:hello_world
missing numpy. so complete pip install is:

pip install numpy six

final output:

...
INFO: Elapsed time: 76.780s, Critical Path: 67.57s
INFO: 409 processes: 2 internal, 407 darwin-sandbox.
INFO: Build completed successfully, 409 total actions
INFO: Build completed successfully, 409 total actions
I20210331 15:16:51.669309 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670514 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670562 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670596 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670634 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670663 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670693 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670722 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670758 319131136 hello_world.cc:56] Hello World!
I20210331 15:16:51.670791 319131136 hello_world.cc:56] Hello World!
  1. setup Android SDK and NDK.
sh setup_android_sdk_and_ndk.sh ../Android/Sdk ../Android/Sdk/ndk-bundle r18b
  1. build all MediaPipe Android example apps !
sh build_android_examples.sh

final output:

...
INFO: Elapsed time: 327.910s, Critical Path: 26.12s
INFO: 45 processes: 10 internal, 30 darwin-sandbox, 5 worker.
INFO: Build completed successfully, 45 total actions

Connect your device via adb to install the apps.
Press 'a' to abort, or press any other key to continue ...

Android example apps build successful !

@jiuqiant
Copy link
Contributor

jiuqiant commented Apr 2, 2021

Glad to hear that. FYI, the troubleshooting instruction mentions this numpy issue: https://google.github.io/mediapipe/getting_started/troubleshooting.html#missing-necessary-python-packages ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:android Issues with Android as Platform type:build/install For Build and Installation issues
Projects
None yet
Development

No branches or pull requests

4 participants