gradle protobuf插件不起作用

gradle protobuf插件不起作用,gradle,build.gradle,gradle-plugin,Gradle,Build.gradle,Gradle Plugin,我在一个项目中使用了下面提到的protobuf gradle插件,该插件工作正常,但当我在另一个项目中引用相同的插件时,“gradle clean”始终给我以下复制的错误: build.grade(v3.4)的相关部分 运行gradle clean时出错 * What went wrong: Could not compile build file '/xyz/xyz/build.gradle'. > startup failed: build file '/xyz/xyz/build

我在一个项目中使用了下面提到的protobuf gradle插件,该插件工作正常,但当我在另一个项目中引用相同的插件时,“gradle clean”始终给我以下复制的错误:

build.grade(v3.4)的相关部分

运行gradle clean时出错

* What went wrong:
Could not compile build file '/xyz/xyz/build.gradle'.
> startup failed:
  build file '/xyz/xyz/build.gradle': 102: you tried to assign a value to the class 'org.gradle.api.component.Artifact'
   @ line 102, column 9.
             Artifact = 'com.google.protobuf:protoc:3.2.0'
             ^

  build file '/xyz/xyz/build.gradle': 106: you tried to assign a value to the class 'org.gradle.api.component.Artifact'
   @ line 106, column 13.
                 Artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"

我试过protobuf插件0.8.0。和0.8.1,但两者给出相同的误差。v0.8.0在不同的项目中工作。任何关于如何进一步排除故障的想法都将不胜感激。

它应该是
工件
,而不是
工件
。后者是您试图分配给的一个类,但它不起作用,前者是您分配给的属性。

它应该是
工件
,而不是
工件
。后者是您试图分配给的一个类,但该类不起作用,前者是您分配给的属性

* What went wrong:
Could not compile build file '/xyz/xyz/build.gradle'.
> startup failed:
  build file '/xyz/xyz/build.gradle': 102: you tried to assign a value to the class 'org.gradle.api.component.Artifact'
   @ line 102, column 9.
             Artifact = 'com.google.protobuf:protoc:3.2.0'
             ^

  build file '/xyz/xyz/build.gradle': 106: you tried to assign a value to the class 'org.gradle.api.component.Artifact'
   @ line 106, column 13.
                 Artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"