I have tried everything possible to build project using gradle but my gradle is not working.Please see below exception trace and suggest?
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'outbound-campaigns'.
Could not resolve all dependencies for configuration ':classpath'.
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://nexus-ott.forge.avaya.com/repository/metam-maven/)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.5/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
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 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 10s
Related
I'm working on moving my project's build from Maven to Gradle, and using Kotlin as the DSL within Gradle. Here is my working branch. The project currently is a multi-module project, and I'm using the gradle-root subdirectory in the repo to slowly migrate each module over to using Gradle. The project is Spring Boot based.
The issue I'm hitting at the moment is with the first submodule I'm trying to move, which is the data model (comixed-model, which has no project dependencies). I can figure out how to tell Gradle how to get the dependencies it needs, such as Jackson FasterXML.
I've configured the project to use the Spring Boot plugin. But the FasterXML dependencies aren't being found. Instead, I get:
-> % gradle clean build
> Task :comixed-model:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':comixed-model:compileJava'.
> Could not resolve all files for configuration ':comixed-model:compileClasspath'.
> Could not find com.fasterxml.jackson.core:jackson-annotations:.
Required by:
project :comixed-model
> Could not find com.fasterxml.jackson.core:jackson-databind:.
Required by:
project :comixed-model
> Could not find com.fasterxml.jackson.dataformat:jackson-dataformat-xml:.
Required by:
project :comixed-model
* 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 616ms
15 actionable tasks: 5 executed, 10 up-to-date
I'm not sure what I've done wrong, and Googling doesn't seem to be showing me any solutions.
I have attempted to rebuild the jar for https://github.com/square/okhttp library. However, this is the error I get after first cloning it and then calling "gradle assemble". Is there something incorrect about my method?
FAILURE: Build failed with an exception.
Where:
Build file '/Users/test/okhttptest/okhttp/build.gradle' line: 75
What went wrong:
Plugin [id: 'ru.vyarus.animalsniffer', version: '1.5.1'] was not found in any of the following sources:
Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
Plugin Repositories (could not resolve plugin artifact 'ru.vyarus.animalsniffer:ru.vyarus.animalsniffer.gradle.plugin:1.5.1')
Searched in the following repositories:
Gradle Central Plugin Repository
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 617ms
You problem is that you are using a locally installed gradle version since your call is "gradle assemble". your gradle version is propably too old so you it can't handle the plugin.
This repository has a gradle-wrapper (gradlew) checked in.
https://docs.gradle.org/current/userguide/gradle_wrapper.html
change your call into ./gradlew assemble and the wrapper will handle the download of the required gradle version and will handle all the dependencies for you.
I am trying to build Gradle projects. Installed Gradle's latest version (6.0.1) using Homebrew. When I try gradle build in various projects (for example https://github.com/arnabmitra/trustlines-demo), it gives this error:
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.ExceptionInInitializerError (no error message)
> org.gradle.api.internal.file.DefaultSourceDirectorySet.<init>(java.lang.String, org.gradle.api.internal.file.FileResolver, org.gradle.api.internal.file.collections.DirectoryFileTreeFactory)
* 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 1m 25s
Similar errors happened with other projects. It's my first time using Gradle (come from Maven) and what I am trying to do is just compile the project to have .class files.
Don't use your installation of gradle. Use ./gradlew. That will automatically download and use the version of gradle that the project uses, instead of an incompatible version.
See https://docs.gradle.org/current/userguide/gradle_wrapper.html
If you are using Kotlin 1.3.10, update Kotlin to at least 1.3.20.
Issue was that Kotlin 1.3.10 uses the DefaultSourceDirectorySet constructor via reflection which has been removed in Gradle 6: https://discuss.gradle.org/t/the-defaultsourcedirectoryset-constructor-has-been-deprecated/29610
these are the errors I receive;
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\AndyKhayaMhlanga\.gradle\daemon\helloWorld3\app\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Could not create plugin of type 'AppPlugin'.
> com/android/ide/common/blame/MessageReceiver
* 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
CONFIGURE FAILED in 9s
ERROR: Unable to load class 'com.android.ide.common.blame.MessageReceiver'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
You can try some of the things it's suggesting. I would start with syncing Gradle again: in Android Studio, do File -> Sync Project with Gradle Files
This will make sure all dependencies download.
I do believe when you launch a new app Android Studio automatically a TextView saying, "Hello, World" in the center. I this what you want to accomplish?
If not, this has happened to me before perhaps going back to the first version or starting over would help. If you start over go step by step first the layout then snippets of code. And when it doesn't work you'll know what is wrong.
Hope this helps!
I'm trying to run a Gradle build for an existing Java project, but I get the following error that appears to be unrelated to my project.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':myProject:test'.
> Could not get unknown property 'testSrcDirs' for task ':myProject:test' of type org.gradle.api.tasks.testing.Test.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
How can I fix this error?
If you land on this page searching for the testSrcDir exception, try updating the gradle clover plugin jar from 2.0.1 to latest versions.
If can't update the version you could also try the workaround suggested here
test {
ext.testSrcDirs = project.sourceSets.test.java.srcDirs
}
For me, the issue was that my project needed to be built with Gradle 2.x but I was using Gradle 3.x. Once I reverted my Gradle version, the build worked.