0

Generated .pbgrpc.dart has below code,

@$pb.GrpcServiceName('') class Client extends $grpc.Client {

Error - Undefined name '$pb' used as an annotation. Try defining the name or importing it from another library.

My dart version is 3.0.5 and protoc is 23.3

Can you please let me know what is being missed.

1 Answers1

2

https://github.com/google/protobuf.dart/issues/844

if protoc_plugin is still not released in version 21.0.1 you can install fix from repo

dart pub global activate --source git https://github.com/google/protobuf.dart --git-path protoc_plugin
Rei
  • 61
  • 3
  • thank you for the note, but it did not seem to fix the issue even after using the source on git as indicated, might have to wait for new grpc with protobuf 3.0? – Venki Muthanna Jun 19 '23 at 04:13
  • 1
    I have `grpc: ^3.2.1`, `protobuf: ^3.0.0` and `protoc_plugin: 21.0.1`. If I remember correctly it didn't work straight away at first. What helped was `flutter clean` or `flutter pub cache clean`. – Rei Jun 20 '23 at 05:35