grpc-swift: Swift Package Manager 5.1.0 missing SwiftGRPC on Import
New Issue Checklist
- Updated grpc-swift to the latest version
- I read the Contribution Guidelines
- I searched for existing GitHub issues(especially, there are many resolved issues related to SSL)
Issue Description
Starting with an Swift UI application in Xcode
- Single View App
- Enter Required Info
- Unchecked Include Unit Tests / Include UI Tests
- Went to add package dependency
- Used the following url
https://github.com/grpc/grpc-swift
- Selected Branch and typed in nio
- Confirmed that under Package Product the only fields were GRPC | Library | Name Of Project
- Clicked Finish
- Went to SceneDelegate.swift then proceeded to type in import SwiftGRPC
- Resulting error of
No such module SwiftGRPC
- Types in GRPC instead via this route and has no issues
- Import the .grpc and .pb.swift files as mentioned here, medium starter
- As a result inside of the files the following message is shown in step 10.
Unsure of how to proceed based upon the documentation in the readMe, also looking into the following Stack Overflow thread this solution did not appear to work either. Any help would be appreciated.
Thanks
Complete output when running grpc-swift, including the stack trace and command used
No such module `SwiftGRPC`
Environment
Key | Value |
---|---|
OS Version | 10.15.3 |
Swift Version | 5.1.3 |
Xcode Version | 11.3.1 |
gRPC-Swift Version | 1.0.0-alpha.9 |
gRPC-Swift Version | 1.0.0-alpha.9 |
protoc Version | 3.11.3 |
protoc-gen-swift Version | 1.5.0 |
protoc-gen-swiftgrpc Version | ?.?.? |
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (2 by maintainers)
Got it! This is now working thank you! I had installed
grpc-swift
from Homebrew which appears to have not had theprotoc-gen-grpc-swift
binary in it.@trujamal sorry for the slow response here; I’ve been away.
The tutorial linked is for the old version of (aka
SwiftGRPC
); the missing files you’re seeing here are for that version of gRPC Swift. I.e. you’re using generated code for the old version with the runtime for the new version (GRPC
).The instructions for generating the code from that article broadly apply to the new version as well. However they are not specific enough:
This is correct but you must also checkout the version of gRPC Swift that is resolved in
Package.resolved
(orPackage.swift
if you depend on an exact version).This isn’t necessary unless you want to build the old version with Xcode via Swift Package Manager.