Meaning of errors during gradle build - gradle

I get an error when trying to build using gradle.
What does this error mean?
E:\intellij-project\MyProject>gradle build
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':compileJava'.
> Cannot specify -processorpath or --processor-path via `CompileOptions.compilerArgs`. Use the `CompileOptions.annotationProcessorPath` property instead.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
1 actionable task: 1 executed
E:\intellij-project\MyProject>

This is a change made in Gradle 4.5 that became a breaking change in Gradle 5.0:
You should not put annotation processors on the compile classpath or declare them with the -processorpath compiler argument.
They should be added to the annotationProcessor configuration instead. If you don’t want any processing, but your compile classpath contains a processor unintentionally (e.g. as part of a library you depend on), use the -proc:none compiler argument to ignore it.
See upgrade documentation.

Related

Gradle Project declares a dependency from configuration 'detachedConfiguration1' to configuration 'default'

I have a gradle project https://gist.github.com/iva-nova-e-katerina/f5428f52afa36c5f2719d047ccc53213 and run it with "./gradlew build" with following error:
└─$ ./gradlew build
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Parallel execution is an incubating feature.
> Configure project :
ArtifactoryUser user: null
Using Java from /home/katya/java (version 11.0.2)
Detected development environment
[buildinfo] Properties file path was not found! (Relevant only for builds running on a CI Server)
FAILURE: Build failed with an exception.
* Where:
Script '/home/katya/tmp_work/groovy/gradle/binarycompatibility.gradle' line: 67
* What went wrong:
Could not determine the dependencies of task ':groovy-console:japicmp'.
> Could not resolve all files for configuration ':groovy-console:detachedConfiguration1'.
> Could not resolve org.codehaus.groovy:groovy-console:2.4.16.
Required by:
project :groovy-console
> Project :groovy-console declares a dependency from configuration 'detachedConfiguration1' to configuration 'default' which is not declared in the descriptor for project :groovy-console.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
Could you explain what is going on? What is 'detachedConfiguratoin1' and how to fix this error?

Execution failed for task app:processDebugMainManifest> Manifest merger failed with multiple errors --stacktrace option Run with --info or --debug

Execution failed for task ':app:processDebugMainManifest'.
Manifest merger failed with multiple errors, see logs
Try:
Run with --stacktrace option to get this stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
the answer of this error you just need to add the library in your gradle
gradle -> gradle.properties
android.enableJetifier=true
the answer of this error you just need to add the library in your gradle
gradle -> gradle.properties
android.enableJetifier=true
the answer of this error you just need to add the library in your gradle gradle -> gradle.properties
android.useAndroidX=true
android.enableJetifier=true

Plugin with id 'osgi' not found

I am trying to build a project(https://github.com/fge/btf) locally using gradle. There is a plugin "osgi" being used but whenever I build it, I get the error plugin not found. I have tried giving different flavors of OSGi, added the repositories and dependency. Still getting the same error. Please help. Thanks in advance.
FAILURE: Build failed with an exception.
Where:
Build file '/root/btf-1.2/build.gradle' line: 61
What went wrong:
A problem occurred evaluating root project 'btf'.
Plugin with id 'osgi' not found.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
BUILD FAILED in 1s
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
logs generated are as below
Gradle has discontinued their built-in osgi plugin. Please see the Bnd Gradle plugins.
https://github.com/bndtools/bnd/blob/master/biz.aQute.bnd.gradle/README.md#replacing-use-of-gradles-deprecated-osgi-plugin

gradlew wrapper update to new version error that you have old version

Why gradle build failed:
./gradlew wrapper --gradle-version 6.2
FAILURE: Build failed with an exception.
* Where:
Build file '/home/yburtsev/IdeaProjects/spring-io-testcontainers-workshop/build.gradle' line: 3
* What went wrong:
An exception occurred applying plugin request [id: 'org.springframework.boot', version: '2.2.4.RELEASE']
> Failed to apply plugin [id 'org.springframework.boot']
> Spring Boot plugin requires Gradle 4.10 or later. The current version is Gradle 4.4.1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
I manually edit distributionUrl in gradle-wrapper.properties to 6.2 version and than run gradlew wrapper command successfully.
link to project: https://github.com/bsideup/spring-io-testcontainers-workshop
The wrapper task will be run with the previous version of Gradle first. In your case, that is apparently 4.4.1. I don't know why it evaluates the whole project build for the wrapper task, but it does. And since you are using a plugin that is not compatible with that version, it fails.
As you already did, it can be circumvented by editing the file gradle/wrapper/gradle-wrapper.properties manually and set it to the new version. But remember to run the wrapper task again after you did that. This will make it download the new version and use that to update the other wrapper files if needed.
There is a corresponding Github issue for this problem. If you like, you can go put a "thumbs up" on it to give it more attention: https://github.com/gradle/gradle/issues/884.

build error netflix fenzo library

The Netflix fenzo (https://github.com/Netflix/Fenzo) build fails complaining on gradle plugin from netflix not available.
Stack trace below
> Configure project :
Inferred project: fenzo, version: 1.1.0-SNAPSHOT
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/UKHANVA/git/Fenzo/build.gradle' line: 32
* What went wrong:
A problem occurred evaluating root project 'fenzo'.
> Failed to apply plugin [class 'nebula.plugin.info.dependencies.DependenciesInfoPlugin']
> Could not create plugin of type 'DependenciesInfoPlugin'.
> No signature of method: org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.DefaultVersionComparator.asStringComparator() is applicable for argument types: () values: []
Possible solutions: asVersionComparator()
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 12s
I suspect you are using the version of gradle you have in your path:
gradle build
Try running the build with the gradle wrapper script in the repository:
./gradlew build
The version of gradle used by the wrapper is configured in gradle/wrapper/gradle-wrapper.properties. Fenzo is using 2.13 which is quite old.
By experimenting with the wrapper version, I found that it builds successfully with Gradle 2.x & 3.x but not 4.x.
Gradle 4.0 gave me the exact same error as above. 4.8 also failed but with a different error.

Resources