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

bazel build error : platformclasspath.jar failed (Exit 1): java failed: error executing command #2776

Closed
pekochun opened this issue Nov 15, 2021 · 9 comments
Assignees
Labels
legacy:hands Hand tracking/gestures/etc platform:android Issues with Android as Platform type:build/install For Build and Installation issues

Comments

@pekochun
Copy link

Please make sure that this is a build/installation issue and also refer to the troubleshooting documentation before raising any issues.

System information (Please provide as much relevant information as possible)

  • OS Platform and Distribution
    I use macOS Big Sur version 11.5.2

  • Compiler version (e.g. gcc/g++ 8 /Apple clang version 12.0.0):
    Mac terminal

  • Programming Language and version ( e.g. C++ 14, Python 3.6, Java ):
    bazel

  • MediaPipe version:
    I didn't know how to look it up.

  • Bazel version:
    Bazelisk version: development
    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

  • XCode and Tulsi versions (if iOS):
    Xcode13.0

  • Android SDK and NDK versions (if android):
    Android SDK 31.00
    Android NDK 21.47075529

  • Android AAR ( if android):
    I don't know what this means.

  • OpenCV version (if running on desktop):
    I didn't know how to look it up.

Describe the problem:
I followed the tutorial below to configure bazel.
https://google.github.io/mediapipe/getting_started/android.html
However, I got an error.
I will show the error message later.

I tried the following command.
$ bazel build -c opt --config=android_arm64 mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu

Complete Logs:
This is the error message.

(base) Mac-mini:mediapipe mac$ export ANDROID_HOME=/Users/mac/Library/Android/sdk
(base) Mac-mini:mediapipe mac$ export ANDROID_NDK_HOME=/Users/mac/Library/Android/sdk/ndk/21.4.7075529
(base) Mac-mini:mediapipe mac$ bazel build -c opt --config=android_arm64 mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu
DEBUG: /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/external/org_tensorflow/third_party/repo.bzl:109:14: 
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/external/org_tensorflow/third_party/repo.bzl:109:14: 
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/external/org_tensorflow/third_party/repo.bzl:109:14: 
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/external/org_tensorflow/third_party/repo.bzl:109:14: 
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/external/org_tensorflow/third_party/repo.bzl:109:14: 
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/external/org_tensorflow/third_party/repo.bzl:109:14: 
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/external/org_tensorflow/third_party/repo.bzl:109:14: 
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/external/org_tensorflow/third_party/repo.bzl:109:14: 
Warning: skipping import of repository 'bazel_skylib' because it already exists.
DEBUG: /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/external/org_tensorflow/third_party/repo.bzl:109: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.
WARNING: API level 30 specified by android_ndk_repository 'androidndk' is not available. Using latest known API level 29
DEBUG: Rule 'android_opencv' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "cdb0e190c3734edd4052a3535d9e4310af912a9f70a421b1621711942a1028d5"
DEBUG: Repository android_opencv instantiated at:
  /Users/mac/mediapipe/WORKSPACE:218:13: in <toplevel>
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: Analyzed target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu (0 packages loaded, 18053 targets configured).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_mac/686390cc5137afebad5267456e3662e5/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/handtrackinggpu:handtrackinggpu failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.900s, Critical Path: 0.73s
INFO: 129 processes: 129 internal.
FAILED: Build did NOT complete successfully
@pekochun pekochun added the type:build/install For Build and Installation issues label Nov 15, 2021
@sgowroji
Copy link

Hi @pekochun, I see your previous issue is resolved . If the above error is seen after the previous issue. Then i recommend going through this two issues #1822, #68 which have same error logs with jdk while installation. Let me know if you still see the above error logs. Thanks!

@sgowroji sgowroji added platform:android Issues with Android as Platform legacy:hands Hand tracking/gestures/etc stat:awaiting response Waiting for user response labels Nov 16, 2021
@pekochun
Copy link
Author

I tried the following commands mentioned in those issues, but to no avail.
sudo apt install default-jdk

I then tried the following commands mentioned in the above issue, but it appears to have broken the environment even more.
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

@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

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

@sgowroji sgowroji added stat:awaiting googler Waiting for Google Engineer's Response and removed stat:awaiting response Waiting for user response stale labels Nov 30, 2021
@sgowroji sgowroji assigned jiuqiant and unassigned sgowroji Nov 30, 2021
@sgowroji
Copy link

Hi @pekochun, If you are trying to build Hands solution in Android . You can have a look at our gradle api implementation from here https://google.github.io/mediapipe/getting_started/android_solutions.html#mediapipe-android-solutions

@sgowroji sgowroji added stat:awaiting response Waiting for user response and removed stat:awaiting googler Waiting for Google Engineer's Response labels Nov 30, 2021
@sgowroji sgowroji reopened this Nov 30, 2021
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

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

@sgowroji sgowroji removed stat:awaiting response Waiting for user response stale labels Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:hands Hand tracking/gestures/etc 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