我正在尝试在我的 Android 应用程序中使用 Protobuf。为此,我在 gradle.build 文件中添加了以下几行:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.5.0"
}
}
apply plugin: "com.google.protobuf"
sourceSets {
main {
proto {
// In addition to the default 'src/main/proto'
srcDir '../../../Libs/Protocol'
}
}
}
protobuf {
protoc {
path = '/usr/local/bin/protoc'
}
}
问题是我在构建 gradle 时遇到错误。它说:
Error:Execution failed for task ':app:generateDebugProto'.
> protoc: stdout: . stderr: protoc-gen-javanano: program not found or is not executable
--javanano_out: protoc-gen-javanano: Plugin failed with status code 1.
你能帮我解决这个问题吗?我不知道如何解决它。
先感谢您 !