Closed emeraldhieu closed 1 year ago
Use a newer version of protoc. This isn't a problem with the plugin; the older protobuf versions didn't support aarch64 on Mac.
@ejona86 hi!
I updated protoc to the newest version but still get a similar error. What do I do wrong?
Here is my setup:
import com.google.protobuf.gradle.id
val grpcKotlinVersion = "1.4.1"
val grpcVersion = "1.61.0"
val protobufVersion = "3.25.2"
plugins {
kotlin("jvm")
id("com.google.protobuf")
}
repositories {
mavenCentral()
}
dependencies {
api("io.grpc:grpc-kotlin-stub:$grpcKotlinVersion")
api("io.grpc:grpc-protobuf:$grpcVersion")
api("io.grpc:grpc-netty:$grpcVersion")
api("com.google.protobuf:protobuf-kotlin:$protobufVersion")
}
kotlin {
jvmToolchain(17)
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobufVersion"
}
plugins {
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
}
id("grpckt") {
artifact = "io.grpc:protoc-gen-grpc-kotlin:$grpcKotlinVersion:jdk8@jar"
}
}
generateProtoTasks {
all().forEach {
it.plugins {
id("grpc")
id("grpckt")
}
it.builtins {
id("kotlin")
}
}
}
}
The error:
Execution failed for task ':my-service:generateProto'.
> protoc: stdout: . stderr: /Users/my-name/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.61.0/2dfdef88b003b4ad87072a2ce214579fd670bd63/protoc-gen-grpc-java-1.61.0-osx-aarch_64.exe: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.2.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 349ms
13 actionable tasks: 1 executed, 12 up-to-date
I found few related issues and just installed Rosetta 2 by the following command in Terminal:
softwareupdate --install-rosetta --agree-to-license
Hello, I'm using "protobuf-gradle-plugin/examples/exampleProject" at tag v0.9.2.
I get this error.
Apple M2 MacOS Ventura
Any idea how to fix it?