我正在尝试使用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'
}
有没有少了什么的线索?
1条答案
按热度按时间8ehkhllq1#
对于我更新这行
artifact =“com.google.protobuf:protoc:3.18.0”
与此行具有相同的版本号解决了问题。
实现“com.google.protobuf:protobuf-javalite:3.18.0”