Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot generate code on Windows 10 #139

Closed
muku opened this issue Nov 29, 2018 · 11 comments
Closed

Cannot generate code on Windows 10 #139

muku opened this issue Nov 29, 2018 · 11 comments

Comments

@muku
Copy link

muku commented Nov 29, 2018

I am on Dart VM version: 2.1.0-dev.9.4.flutter-f9ebf21297

I'm following the Dart quickstart guide for grpc. I am trying to generate the Dart code on Windows 10 but I get the following error:

dart_out: protoc-gen-dart: The system cannot find the file specified.

I have added the Pub\Cache\bin in my path and tried the commands from the quickstart guide in GRPC's page:

pub global activate protoc_plugin
git clone https://github.com/grpc/grpc-dart
cd grpc-dart/example/helloworld
protoc --dart_out=grpc:lib/src/generated -Iprotos protos/helloworld.proto

I have also tried specifying the full path like this:

protoc --dart_out=grpc:lib/src/generated -Iprotos protos/helloworld.proto --plugin=protoc-gen-dart=c:\Users\[myself]\AppData\Roaming\Pub\Cache\bin\protoc-gen-dart.bat

In this case I get the following error:

--dart_out: protoc-gen-dart: The system cannot find the path specified.

@zoechi
Copy link

zoechi commented Nov 29, 2018

@muku
Copy link
Author

muku commented Nov 29, 2018

Related SO question https://stackoverflow.com/questions/53538315/dart-grpc-windows-10-cannot-generate-code

Yeah that's me also asking in SO just in case I might be doing something wrong. But it looks like a bug to be honest. That's why I opened an issue here.

@sigurdm
Copy link
Contributor

sigurdm commented Nov 30, 2018

What version of protoc are you using? I think this should have been fixed by: protocolbuffers/protobuf#5105.
I would think that should have gone into v3.6.1.1 of protoc.

@muku
Copy link
Author

muku commented Nov 30, 2018

I am on 3.6.1. It's going to be a pain to set up the environment to build protobuf but I'll give it a try.

@sigurdm
Copy link
Contributor

sigurdm commented Nov 30, 2018

I'm surprised the direct path did not help.
Do you have the bat-file on c:\Users\[myself]\AppData\Roaming\Pub\Cache\bin\protoc-gen-dart.bat?
This seems to have worked at: #71

@muku
Copy link
Author

muku commented Nov 30, 2018

Yeah the bat is under this path. I had seen the issue you mentioned, that's why I tried the direct path. But it didn't work for me. I haven't tried to compile the latest code yet. I will try and see if that solves the issue.

@muku
Copy link
Author

muku commented Dec 1, 2018

I tried to compile protoc last night but I stumbled upon too many errors with cmake looking for files that didn't exist. I couldn't be bothered to fix the build environment. I'll probably ditch grpc on my flutter client and code a proxy REST server in C# or Go to talk with the main server. I might give this a try in the future when a new version of protoc is released.

@sigurdm
Copy link
Contributor

sigurdm commented Dec 4, 2018

I'm sorry not to be of more help.

I'll close this issue for now as it is a duplicate of earlier closed bugs.
Please reopen if the next published version of protoc doesn't improve the situation.

@sigurdm sigurdm closed this as completed Dec 4, 2018
@anxpp
Copy link

anxpp commented Jan 24, 2019

you need install dart2.x +

@anxpp
Copy link

anxpp commented Jan 24, 2019

I have the same problem at first, then I installed the 2.x dart and every is OK.

@JohnGalt1717
Copy link

This is still an issue. This should be a flutter dev dependency that just works: and it should just work. the mess we have right now is basically unusuable especially on windows.

protoc --proto_path=d:\Repos<path to system.proto>\ --dart_out=plugins=grpc . system.proto

This doesn't work even though system.prot is absolutely in the path.

Gets:

warning: directory does not exist.
.: File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think)

.NET does this automatically with a simple save of the proto file. It's unfathomable that it's this difficult to generate dart made by Google for gRPC made by Google yet Microsoft can make gRPC made by Google, not Microsoft, work just fine the way it should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants