我正在尝试使用gradle编译protobuf项目。但是,在protobuf生成的Java文件中,我遇到了以下错误:
这是build.gradle文件:
// Apply the java-library plugin to add support for Java Library
apply plugin: 'java-library'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.protobuf:protobuf-java:3.5.1'
implementation 'com.google.protobuf:protobuf-gradle-plugin:0.8.7'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
有什么遗漏的提示吗?
protobuf-gradle-plugin
不应该成为你的应用程序依赖的一部分。相反,它是一个放在顶层 gradle 文件的 gradle 插件,你需要应用它。 - undefined