grpc-swift: Protoc-generated swift files not compatible with SwiftGrpc (CocoaPods)
- I have installed in my project SwiftGrpc via CocoaPods
- Then I generated Swift proxy files via:
protoc <your proto files> \
--swift_out=. \
--swiftgrpc_out=.
-
Then I dragged generated swift files into project, but the project doesn’t compile (see screenshot) ScreenShot
-
When I checked handleMethod definition (from SwiftGrpc CocoaPods) I see different definition like this:
/// Handle the given method. Needs to be overridden by actual implementations.
/// Returns whether the method was actually handled.
open func handleMethod(_ method: String, handler: Handler, queue: DispatchQueue) throws -> Bool { fatalError("needs to be overridden") }
- Also HandleMethodError enum is not defined inside SwiftGrpc (CocoaPods)
Any ideas?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 23
Issue resolved ny updating “protoc-gen-swiftgrpc” .
Note that I do not recommend using non-SSL services in production 😉
Same problem here.
I fixed with @eaigner advise. ( Thanks 😃 )
SwiftGRPC:
0.4.2
protoc --versionlibprotoc 3.5.1
protoc-gen-swift --versionprotoc-gen-swift 1.0.3
protoc-gen-swiftgrpc --version : It doesn’t get the version so I assume it’s 1.03 too.My project is using cocoa pods and this is the pod line in the Podile for SwiftGRPC:
pod 'SwiftGRPC', '= 0.4.2'