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

Version 0.8.6: * What went wrong: Execution failed for task ':article:generateProto'. > protoc: stdout: . stderr: --grpckotlin_out: protoc-gen-grpckotlin: %1 is not a valid Win32 application #268

Closed
UkonnRa opened this issue Oct 11, 2018 · 5 comments
Assignees

Comments

@UkonnRa
Copy link

UkonnRa commented Oct 11, 2018

Using ./gradlew clean generateProto and got the following error on Windows 10:

* What went wrong: Execution failed for task ':article:generateProto'. > protoc: stdout: . stderr: --grpckotlin_out: protoc-gen-grpckotlin: %1 is not a valid Win32 application

But the same command works fine on my Mac

@zpencer
Copy link
Contributor

zpencer commented Oct 11, 2018

Is protoc-gen-grpckotlin a third party plugin?
Can you share more info on how your build.gradle is configured?

Also, if you run your build with --info you will get some additional info that is helpful for debugging. Can you paste it here?
For the failing generateProto task, there should be a line immediately above your pasted line that shows the exact command line invocation.

$ ./gradlew clean build --info

@zpencer zpencer self-assigned this Oct 11, 2018
@rocketraman
Copy link

I have a similar problem with the Kroto+ plugin, which is declared in the build as follows:

protobuf {
  protoc {
    artifact = 'com.google.protobuf:protoc:3.6.1'
  }
  plugins {
    kroto {
      artifact = "com.github.marcoferrer.krotoplus:protoc-gen-kroto-plus:$krotoplusVersion:jvm8@jar"
    }
  }
  ...
}

When actually executed, this adds the following additional parameter to the protoc invocation:

 --plugin=protoc-gen-kroto=C:\Users\Me\.gradle\caches\modules-2\files-2.1\com.github.marcoferrer.krotoplus\protoc-gen-kroto-plus\0.1.3\3c41d071d04c8558822447643894490e33a857b7\protoc-gen-kroto-plus-0.1.3-jvm8.jar

It appears that protoc is attempting to load this jar file as a Win32 application, and failing to do so with the "not a valid Win32 application" error result.

I have tried associating jar files to java, and this seems to have worked, but the error remains the same.

@zpencer
Copy link
Contributor

zpencer commented Oct 24, 2018

@rocketraman can you clarify what you mean by working, but the error remains the same?

You are correct that protoc plugins are just executables that protoc calls out to. I inspected the jar and it appears to be a spring boot bash script. I'm not sure what's the easiest way to get this working on Windows. I would suggest opening an issue on com.github.marcoferrer.krotoplus.

@rocketraman
Copy link

@rocketraman can you clarify what you mean by working, but the error remains the same?

I meant jar files are correctly associated with java in Windows, but that didn't fix it.

You are correct that protoc plugins are just executables that protoc calls out to. I inspected the jar and it appears to be a spring boot bash script. I'm not sure what's the easiest way to get this working on Windows. I would suggest opening an issue on com.github.marcoferrer.krotoplus.

Yes, @marcoferrer of krotoplus confirmed that the issue is that the spring boot bash script appears not to be executable on windows, and suggested a temporary workaround of a batch script that in turn executes the plugin. This does seem to work. So there doesn't appear to be any issue with the protobuf gradle plugin. Sorry for the noise!

@marcoferrer
Copy link
Contributor

@zhangkun83 Since this isnt related to the protobuf plugin I think it can be closed out.

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