编译错误:
Execution failed for task ‘:app:generateGhDebugProto’.
Could not resolve all files for configuration ‘:app:protobufToolsLocator_protoc’.
Could not find protoc-3.11.0-osx-aarch_64.exe (com.google.protobuf:protoc:3.11.0).
Searched in the following locations:
build.gradle(app)
protobuf {
//配置protoc编译器
protoc {
if (osdetector.os == "osx") {
artifact = 'com.google.protobuf:protoc:3.11.0:osx-x86_64'
} else {
artifact = 'com.google.protobuf:protoc:3.11.0'
}
}
//这里配置生成目录,编译后会在build的目录下生成对应的java文件
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
}
task.builtins {
java {}
}
}
}
}