well_known_types_embed.cc - /bin/sh: js_embed: com

2019-08-18 20:33发布

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

标签: android c++ grpc
2条回答
做自己的国王
2楼-- · 2019-08-18 21:08

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

 /gradlew installDebug --stacktrace

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.

查看更多
神经病院院长
3楼-- · 2019-08-18 21:21

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:

cd third_party/protobuf
git cherry-pick cba18efe1861d1fc1eecd6dc2af86fc1f0d9922f
查看更多
登录 后发表回答