简体   繁体   English

我的Java项目的gradle构建错误

[英]Error for gradle build for my Java project

I am trying to build the Java project located at here: https://github.com/garlicPasta/dotServer 我正在尝试构建位于此处的Java项目: https : //github.com/garlicPasta/dotServer

I'm new to Gradle. 我是Gradle的新手。 I downloaded the latest Gradle now (v4.0). 我现在下载了最新的Gradle(v4.0)。 I added the bin folder of Gradle (which includes gradle.bat ) to the path so I can run gradle command everywhere. 我将Gradle的bin文件夹(包括gradle.bat )添加到了路径,以便可以在任何地方运行gradle命令。 Looks like the project requires Google protobuf which it downloads automatically. 该项目似乎需要Google protobuf,并会自动下载。 But when I start the command gradle build , I get the following error: 但是,当我启动命令gradle build ,出现以下错误:

> Configure project :
You are using Gradle 4.0:  This version of the protobuf plugin works with Gradle version 2.12+


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'dotServer'.
> No signature of method: org.gradle.api.internal.tasks.DefaultTaskInputs.source() is applicable for argument types: (com.google.protobuf.gradle.ProtobufSourceDirectorySet_Decorated) values: [main Proto source]
  Possible solutions: collect(), use([Ljava.lang.Object;)

Where is the problem coming from? 问题出在哪里? Can someone try to build the project and let me know? 有人可以尝试构建项目并让我知道吗?

I just upgraded to Android Studio 3 and had the same problem when I upgrade Gradle and it's plugin. 我刚升级到Android Studio 3,并且在升级Gradle及其插件时遇到了同样的问题。

We use Google's Protobuf which was included in build.gradle with version 0.7.6. 我们使用Google Protobuf,它包含在build.gradle中,版本为0.7.6。 I just changed to 0.8.3 and it builds now. 我只是更改为0.8.3而已构建。

buildscript {
...
dependencies {
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM