1
我想在我的Android應用程序中使用Protobuf。 因此,要做到這一點,我添加了以下線在我gradle.build文件:protoc-gen-javanano沒有找到
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.
你能幫我解決這個問題嗎? 我不知道如何解決它。
預先感謝您!
所以,你必須應用程序調用protoc-GEN-javanano在/ usr/local/bin/protoc文件夾中? – Selvin
不,我只是給Gradle中的protoc路徑。但爲了解決我的問題,我添加了該行,但並不是所以我認爲這不是原因。 –
你的假設是錯誤的...這是一個protobuf二進制的路徑 – Selvin