【发布时间】:2020-10-20 03:57:18
【问题描述】:
我要生成的主文件有这些import:
import "protos/google_annotations.proto";
import "protos/nakama_annotations.proto";
import "protos/nakama_api.proto";
文件夹结构:
├── lib
├── protos
├── google_annotations.proto
├── nakama_annotations.proto
├── nakama_api.proto
├── apigrpc.proto <--- this is the file to generate.
高亮语法没问题。(Android studio)
我遇到错误的两种情况是:
1.
-
命令在
protos目录中运行 -
运行
protoc apigrpc.proto --java_out=. --proto_path=. -
得到这个错误
protos/google_annotations.proto: File not found. protos/nakama_annotations.proto: File not found. protos/nakama_api.proto: File not found.
- 指定所有导入文件
-
命令在
protos目录中运行 -
运行
protoc apigrpc.proto --java_out=. --proto_path=google_annotations.proto --proto_path=nakama_annotations.proto --proto_path=nakama_api.proto -
得到这个错误
apigrpc.proto: File does not reside within any path specified using --proto_path
我做错了什么?
【问题讨论】: