I'm trying to run the example from https://github.com/grpc/grpc/tree/master/examples/android/helloworld.
I checked that I have:
Android SDK Android NDK protoc grpc_cpp_plugin
Also I've run git submodule update --init in the repository to download all dependencies.
When I run /gradlew installDebug --stacktrace
I get this error:
Error while executing process
/Users/myuser/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/..path../exampleAndroidUsingCPP/grpc/examples/android/helloworld/app/.externalNativeBuild/cmake/debug/x86 --target protoc}
[1/98] Generating ../../../../../../../../../../../../third_party/protobuf/src/google/protobuf/compiler/js/well_known_types_embed.cc
FAILED: cd /Users/..path../exampleAndroidUsingCPP/grpc/examples/android/helloworld/app/.externalNativeBuild/cmake/debug/grpc/outputs/x86/third_party/protobuf && js_embed /Users/..path../exampleAndroidUsingCPP/grpc/third_party/protobuf/src/google/protobuf/compiler/js/well_known_types/any.js /Users/..path../exampleAndroidUsingCPP/grpc/third_party/pr tobuf/src/google/protobuf/compiler/js/well_known_types/struct.js /Users/..path../exampleAndroidUsingCPP/grpc/third_party/protobuf/src/google/protobuf/compiler/js/well_known_types/timestamp.js > /Users/..path../exampleAndroidUsingCPP/grpc/third_party/protobuf/src/google/protobuf/compiler/js/well_known_types_embed.cc
/bin/sh: js_embed: command not found
ninja: build stopped: subcommand failed.
I'm running this in a OSX
Any idea where I can look to fix it?
Thanks
I made it work.
I think it was involve with updating android Studio. But to be honest I'm not sure.
I clean the directory with any changes made with the unfinished build ( except for the local.properties, where I point where it's the sdk )
I run
And works.
I got another error but it's realed with gradlew. It can't find a device to run the project, so I openned Android studio and worked.
Building gRPC C++ for Android requires a fix to the protobuf build rules (https://github.com/google/protobuf/pull/3878) that is merged into master but hasn't made it into a release yet.
As noted in https://github.com/grpc/grpc/blob/master/examples/android/helloworld/README.md, for the moment you must manually patch this pull request into
third_party/protobuf
before building gRPC for Android. You can do this with the following commands from the grpc repository's root directory: