grpc-swift icon indicating copy to clipboard operation
grpc-swift copied to clipboard

Could not find module 'SwiftProtobuf' for target 'arm64-apple-ios-simulator' & 'i386-apple-ios-simulator'

Open lokeswarisatyanarayanan opened this issue 3 years ago • 5 comments

What are you trying to achieve?

To install the GRPC library into my current project which also uses Firebase.

What have you tried so far?

  • Installed both using pods and it failed because of name conflicts.
  • Tried adding Architectures of the above in build settings
  • Tried opening using Rosetta.

lokeswarisatyanarayanan avatar Jul 08 '22 12:07 lokeswarisatyanarayanan

I also get this error. The repro steps are

1.) Create new Xcode project. 2.) File -> Add Packages 3.) Enter the gRPC URL and click Add Package 4.) Try to build and get the above error.

Help would me much appreciated.

Xcode 13.3.1 on Intel Chip

diatonicman avatar Jul 09 '22 18:07 diatonicman

Could you provide the complete build logs for this?

glbrntt avatar Jul 11 '22 08:07 glbrntt

I resolved that error by adding grpc-swift as a pod with 1.0.0 version and my Firebase packages as SPM.

Here's my pod version

pod 'gRPC-Swift', '~> 1.0.0'

I generate the pb and grpc files using the following commands.

protoc --grpc-swift_out=. presence.proto protoc --swift_out=. presence.proto

The generated files throw multiple errors for missing types in scope in the presence.grpc.swift file.

Adding the screenshot below. Any help would be appreciated!

Screenshot 2022-07-11 at 6 37 52 PM

lokeswarisatyanarayanan avatar Jul 11 '22 13:07 lokeswarisatyanarayanan

You have a version mismatch between the library version (from cocoapods) and the plugin version. The plugin version is newer and is generating code that the library doesn't know about.

FWIW: Cocoapods is no longer supported and the last version published there was 1.8.0.

glbrntt avatar Jul 11 '22 13:07 glbrntt

What got swift package manager working for me was not importing the proto executable Screen Shot 2022-07-15 at 11 57 46 AM

diatonicman avatar Jul 15 '22 19:07 diatonicman