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

Protobuf/classification.proto: C# code generation only supports proto3 syntax #12

Closed
elblogbruno opened this issue Oct 16, 2020 · 23 comments
Assignees

Comments

@elblogbruno
Copy link

I installed everything needed, but running make android_arm gives me this error.
What might be the thing?

protoc --proto_path=Assets/MediaPipe/SDK/Scripts --csharp_out=Assets/MediaPipe/SDK/Scripts/Protobuf Assets/MediaPipe/SDK/Scripts/Protobuf/*.proto && \
protoc --proto_path=Assets/MediaPipe/SDK/Scripts --csharp_out=Assets/MediaPipe/SDK/Scripts/Protobuf/Annotation Assets/MediaPipe/SDK/Scripts/Protobuf/Annotation/*.proto
--csharp_out: Protobuf/classification.proto: C# code generation only supports proto3 syntax
make: *** [Makefile:42: mediapipe_protos] Error 1

Thanks and great work!

@homuler homuler self-assigned this Oct 16, 2020
@homuler
Copy link
Owner

homuler commented Oct 16, 2020

Thank you for reporting the issue.
Which protoc version do you use?

@elblogbruno
Copy link
Author

This is what I do get from calling protoc --version

 protoc --version
libprotoc 3.6.1

I did install it like this:
sudo apt install protobuf-compiler

Thanks

@homuler
Copy link
Owner

homuler commented Oct 16, 2020

It looks like that protoc version must be above v3.11.0 to compile proto2 files.
https://github.com/protocolbuffers/protobuf/releases/tag/v3.11.0

I'll try to remove dependency on protoc, but for now, will you use the latest protoc binary?
https://github.com/protocolbuffers/protobuf/releases/tag/v3.13.0

@elblogbruno
Copy link
Author

Ok I have installed protoc 3.13.0, will try again!
Thanks

@elblogbruno
Copy link
Author

Having this issue now!

/home/bruno/.cache/bazel/_bazel_bruno/918d8a9ae0efa5d029158607c25b218f/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
ERROR: /home/bruno/.cache/bazel/_bazel_bruno/918d8a9ae0efa5d029158607c25b218f/external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/dexer/BUILD:3:13: in deps attribute of java_library rule @bazel_tools//src/tools/android/java/com/google/devtools/build/android/dexer:dexer: alias '//external:android/dx_jar_import' referring to filegroup rule '@androidsdk//:dx_jar_import' is misplaced here (expected cc_binary, cc_library, genrule, genproto, java_import, java_library, java_proto_library, java_lite_proto_library, proto_library, sh_binary or sh_library) and '@androidsdk//:dx_jar_import' does not have mandatory providers: 'CcInfo' or 'JavaInfo'
ERROR: Analysis of target '//mediapipe_api/java/org/homuler/mediapipe/unity:mediapipe_android' failed; build aborted: Analysis of target '@bazel_tools//src/tools/android/java/com/google/devtools/build/android/dexer:dexer' failed
INFO: Elapsed time: 35.422s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (18 packages loaded, 3132 targets configured)
    currently loading: @com_google_protobuf//
make: *** [Makefile:38: android_arm] Error 1

@homuler
Copy link
Owner

homuler commented Oct 16, 2020

Hmm...
Will you try below commands and attach the error log?

cd C
bazel build -c opt --config=android_arm //mediapipe_api/java/org/homuler/mediapipe/unity:mediapipe_android --verbose_failures

I also would like to know your bazel version.

@elblogbruno
Copy link
Author

elblogbruno commented Oct 16, 2020

My bazel version is 3.6.0
and here is the error log

Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server after 10 seconds ...
ERROR: /home/bruno/MediaPipeUnityPlugin/C/WORKSPACE:281:23: //external:android/crosstool depends on @androidndk//:default_crosstool in repository @androidndk which failed to fetch. no such package '@androidndk//': Either the path attribute of android_ndk_repository or the ANDROID_NDK_HOME  environment variable must be set.
ERROR: Analysis of target '//mediapipe_api/java/org/homuler/mediapipe/unity:mediapipe_android' failed; build aborted: Analysis failed
INFO: Elapsed time: 20.447s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (38 packages loaded, 191 targets configured)
    currently loading: @remote_java_tools_linux//

that is strange because i have set the NDK path with export ANDROID_NDK_HOME=/home/bruno/Android/Sdk/ndk-bundle/android-ndk-r18b

@homuler
Copy link
Owner

homuler commented Oct 16, 2020

Can you build the official example now?
https://google.github.io/mediapipe/getting_started/building_examples.html#android

@elblogbruno
Copy link
Author

elblogbruno commented Oct 16, 2020

No I can't issues pop up:

Caused by: java.nio.file.NoSuchFileException: external/local_jdk
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileSystemProvider.isSameFile(UnixFileSystemProvider.java:337)
	at java.base/java.nio.file.Files.isSameFile(Files.java:1530)
	at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.isCurrentPlatform(Locations.java:1860)
	... 14 more
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.
ERROR: /home/bruno/mediapipe/mediapipe/framework/BUILD:36:24 Action external/bazel_tools/tools/jdk/platformclasspath.jar failed (Exit 1) java failed: error executing command external/remotejdk11_linux/bin/java -XX:+IgnoreUnrecognizedVMOptions '--add-exports=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED' -cp ... (remaining 4 argument(s) skipped)

update: i feel i found the solution : google-ai-edge/mediapipe#68 to the error above.

@elblogbruno
Copy link
Author

Ok I could build the official example

@elblogbruno
Copy link
Author

Now running make android_arm I do get this error:

ERROR: Analysis of target '//mediapipe_api/java/org/homuler/mediapipe/unity:mediapipe_android' failed; build aborted: The repository's path is "/home/bruno/Android/sdk" (absolute: "/home/bruno/Android/sdk") but a symlink could not be created for it, because: /home/bruno/Android/sdk (No such file or directory)

@elblogbruno
Copy link
Author

I downgraded to bazel 3.4.0 to see if that fixes the issue!

@homuler
Copy link
Owner

homuler commented Oct 16, 2020

Will you check if your environment variables are right?

ls $ANDROID_HOME
ls $ANDROID_NDK_HOME

@elblogbruno
Copy link
Author

Ok my android home variable was not right. I had sdk instead of Sdk. Let's see if know it all works!
Thanks

@elblogbruno
Copy link
Author

It seemed like everything was alright but..

ERROR: /home/bruno/.cache/bazel/_bazel_bruno/918d8a9ae0efa5d029158607c25b218f/external/bazel_tools/tools/jdk/BUILD:350:14: Action external/bazel_tools/tools/jdk/platformclasspath_classes/DumpPlatformClassPath.class failed (Aborted): javac failed: error executing command external/remotejdk11_linux/bin/javac -source 8 -target 8 -Xlint:-options -cp external/remotejdk11_linux/lib/tools.jar -d ... (remaining 2 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox javac failed: error executing command external/remotejdk11_linux/bin/javac -source 8 -target 8 -Xlint:-options -cp external/remotejdk11_linux/lib/tools.jar -d ... (remaining 2 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0x00007f98a2d36ad1, pid=2, tid=3
#
# JRE version:  (11.0.6+10) (build )
# Java VM: OpenJDK 64-Bit Server VM (11.0.6+10-LTS, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libc.so.6+0x18ead1]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/bruno/.cache/bazel/_bazel_bruno/918d8a9ae0efa5d029158607c25b218f/sandbox/linux-sandbox/176/execroot/mediapipe_api/core.2)
#
# An error report file with more information is saved as:
# /home/bruno/.cache/bazel/_bazel_bruno/918d8a9ae0efa5d029158607c25b218f/sandbox/linux-sandbox/176/execroot/mediapipe_api/hs_err_pid2.log
#
# If you would like to submit a bug report, please visit:
#   http://www.azulsystems.com/support/
#
INFO: Elapsed time: 377.249s, Critical Path: 169.33s
INFO: 206 processes: 206 linux-sandbox.
FAILED: Build did NOT complete successfully
make: *** [Makefile:38: android_arm] Error 1

@homuler
Copy link
Owner

homuler commented Oct 16, 2020

Will you try this command and attach the error log?

bazel build -c opt --config=android_arm //mediapipe_api/java/org/homuler/mediapipe/unity:mediapipe_android --sandbox_debug

@elblogbruno
Copy link
Author

I did clean the cache from .cache/bazel, and it did work now

@elblogbruno
Copy link
Author

Can I now zip the unity project and move it to a windows machine and run it?

@homuler
Copy link
Owner

homuler commented Oct 16, 2020

You cannot run the project on Windows, because the built libraries (e.g. libmediapipe_jni.so, libopencv_java3.so) are incompatible (and also they can be run only on ARM V7 processors).

@elblogbruno
Copy link
Author

elblogbruno commented Oct 16, 2020

well I don't have Unity on linux, I just want to build the apk for android. When I said run I meant use unity on windows to compile the apk.

@homuler
Copy link
Owner

homuler commented Oct 16, 2020

I see. I have never tried it, but if the aar is already built succesfully, I think you can build apk on Windows.

@elblogbruno
Copy link
Author

elblogbruno commented Oct 16, 2020

Ok, Thanks for everything and thanks for the great work on this! Can wait to try and if I can implement it on my project.
Cordially,
Bruno

@homuler
Copy link
Owner

homuler commented Oct 17, 2020

I fixed the build process, and now protoc command is not required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants