protobuf编译报错找不到proto文件
· 2 min read
在新增submodule/api-contract/protobuf/node_manager/v1/
到srcDirs
后, 编译报错, 编译输出如下
> Task :generateProto FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generateProto'.
> protoc: stdout: . stderr: nodemanager/v1/volume.proto: File not found.
nodemanager/v1/tag.proto: File not found.
nodemanager/v1/firewall.proto: File not found.
node.proto:10:1: Import "nodemanager/v1/volume.proto" was not found or had errors.
node.proto:11:1: Import "nodemanager/v1/tag.proto" was not found or had errors.
node.proto:12:1: Import "nodemanager/v1/firewall.proto" was not found or had errors.
node.proto:153:12: "Tag" is not defined.
node.proto:177:12: "VolumeSpec" is not defined.
node.proto:195:12: "Tag" is not defined.
node.proto:212:12: "Tag" is not defined.
node.proto:214:12: "RegisterVolumeSpec" is not defined.
node.proto:269:12: "Tag" is not defined.
node.proto:277:12: "nodemanager.v1.FirewallRule" seems to be defined in "firewall.proto", which is not imported by "node.proto". To use it here, please add the necessary import.
node.proto:299:12: "Volume" is not defined.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
3 actionable tasks: 1 executed, 2 up-to-date