android - well_known_types_embed.cc -/bin/sh : js_embed: command not found

标签 android c++ grpc

我正在尝试运行来自 https://github.com/grpc/grpc/tree/master/examples/android/helloworld 的示例.

我检查过我有:

安卓开发工具包 安卓NDK 协议(protocol) grpc_cpp_plugin

此外,我还在存储库中运行 git submodule update --init 以下载所有依赖项。

当我运行/gradlew installDebug --stacktrace

我收到这个错误:

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.

我在 OSX 中运行它

知道在哪里可以修复它吗?

谢谢

最佳答案

为 Android 构建 gRPC C++ 需要修复 protobuf 构建规则 ( https://github.com/google/protobuf/pull/3878 ),该规则已合并到 master 但尚未发布。

https://github.com/grpc/grpc/blob/master/examples/android/helloworld/README.md 中所述,目前您必须手动将此拉取请求修补到 third_party/protobuf 中,然后再为 Android 构建 gRPC。您可以使用 grpc 存储库根目录中的以下命令执行此操作:

cd third_party/protobuf
git cherry-pick cba18efe1861d1fc1eecd6dc2af86fc1f0d9922f

关于android - well_known_types_embed.cc -/bin/sh : js_embed: command not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50840444/

相关文章:

go - metadata.FromOutgoingContext 和 metadata.FromIncomingContext 有什么区别?

android - 使用 cmake 为 Android 构建 libpng 失败

android - “新项目”失败 : Android Studio 0. 3.4

java - EditText 值在子 ExpandableListView 中重复

c++ - 类中的静态模板函数

rust - 如何使用 openssl 交叉编译一个 rust 项目?

node.js - 检测 NodeJS 中的 GRPC 服务器故障

android - 带有 bool 泛型的 Kotlin 继承

c++ - 删除 std::unique_ptr<Base> 容器中的派生类

c++ - 将 std::string_view 传递给执行 const std::string& 的 API