well_known_types_embed.cc - /bin/sh: js_embed: 找不到命令
well_known_types_embed.cc - /bin/sh: js_embed: command not found
我正在尝试 运行 来自 https://github.com/grpc/grpc/tree/master/examples/android/helloworld 的示例。
我检查过我有:
Android SDK
AndroidNDK
协议
grpc_cpp_plugin
此外,我在存储库中 运行 git 子模块更新 --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++ 需要修复已合并到 master 但尚未发布的 protobuf 构建规则 (https://github.com/google/protobuf/pull/3878)。
如 https://github.com/grpc/grpc/blob/master/examples/android/helloworld/README.md 中所述,目前您必须在为 Android 构建 gRPC 之前手动将此拉取请求修补到 third_party/protobuf
。您可以在 grpc 存储库的根目录中使用以下命令执行此操作:
cd third_party/protobuf
git cherry-pick cba18efe1861d1fc1eecd6dc2af86fc1f0d9922f
我成功了。
我认为这与更新 android Studio 有关。但老实说我不确定。
我用未完成的构建所做的任何更改清理目录(local.properties 除外,我指出它是 sdk 的地方)
我运行
/gradlew installDebug --stacktrace
并且有效。
我遇到了另一个错误,但它已通过 gradlew 实现。它找不到 运行 项目的设备,所以我打开 Android 工作室并开始工作。
我正在尝试 运行 来自 https://github.com/grpc/grpc/tree/master/examples/android/helloworld 的示例。
我检查过我有:
Android SDK AndroidNDK 协议 grpc_cpp_plugin
此外,我在存储库中 运行 git 子模块更新 --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++ 需要修复已合并到 master 但尚未发布的 protobuf 构建规则 (https://github.com/google/protobuf/pull/3878)。
如 https://github.com/grpc/grpc/blob/master/examples/android/helloworld/README.md 中所述,目前您必须在为 Android 构建 gRPC 之前手动将此拉取请求修补到 third_party/protobuf
。您可以在 grpc 存储库的根目录中使用以下命令执行此操作:
cd third_party/protobuf
git cherry-pick cba18efe1861d1fc1eecd6dc2af86fc1f0d9922f
我成功了。
我认为这与更新 android Studio 有关。但老实说我不确定。
我用未完成的构建所做的任何更改清理目录(local.properties 除外,我指出它是 sdk 的地方)
我运行
/gradlew installDebug --stacktrace
并且有效。
我遇到了另一个错误,但它已通过 gradlew 实现。它找不到 运行 项目的设备,所以我打开 Android 工作室并开始工作。