Gradle exception - java

how can i fix this ??
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project
'Procode1'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:1.1.0.
Required by:
:Procode1:unspecified
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.1.0/gradle-1.1.0.pom'.
jcenter.bintray.com
Try: Run with --stacktrace option to get the stack trace. Run with
--info or --debug option to get more log output.
BUILD FAILED
Total time: 29.267 secs
Process finished with exit code 1

I changed proxyPort to 8080 and used jcenter instead of Maven. But i had to apply expeption to use HTTP instead of HTTPS. This is what i have in my gradle.build for build script and allprojects
buildscript {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}
allprojects {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}
android- Gradle: An issue occurred configuring root project android studio

Related

Installing wasmerio using gradle fails

i've just tried using a webassambly in java.
I wanted to use wasmerio to achieve this but following the instructions at https://github.com/wasmerio/wasmer-java (The github page of wasmerio)
I ended up with an exception after running gradle build:
gradle build
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.wasmer:wasmer-jni-amd64-linux:0.2.0.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/wasmer/wasmer-jni-amd64-linux/0.2.0/wasmer-jni-amd64-linux-0.2.0.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project :
* 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 866ms
1 actionable task: 1 executed
My gradle build file look like the following:
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation "org.wasmer:wasmer-jni-amd64-linux:0.2.0"
}
test {
useJUnitPlatform()
}
Any Ideas?
Thanks in advance

:app:dataBindingMergeDependencyArtifactsDebug' Error

What is causing the problem?
I am encountering such an error in my application sale. I couldn't find anything exactly as a solution.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve androidx.core:core-ktx:+.
Required by:
project :app
> Skipped due to earlier error
> Failed to list versions for androidx.core:core-ktx.
> Unable to load Maven meta-data from https://dl.bintray.com/kotlin/kotlin-eap/androidx/core/core-ktx/maven-metadata.xml.
> Could not get resource 'https://dl.bintray.com/kotlin/kotlin-eap/androidx/core/core-ktx/maven-metadata.xml'.
> Could not GET 'https://dl.bintray.com/kotlin/kotlin-eap/androidx/core/core-ktx/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* 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
As #Narendra_Nath said, it is because of the bintray dependencies and Jcenter shutting down.
you can refer to this article https://blog.gradle.org/jcenter-shutdown
the solution that worked for me is changing the repositories in the (Top-level build.gradle) to
buildscript {
repositories {
google()
mavenCentral()
maven {
url "https://repo.spring.io/release"
}
maven {
url "https://repository.jboss.org/maven2"
} }
You need to declare your dependency correctly "androidx.core:core-ktx:$core_version"
This is because bintray support is now no longer there.
Go to your project level build.gradle and comment out the
bintray dependencies in the allprojects and repositories section
Bintray Shutdown

Gradle build is getting failed

I am quite new to gradle world and I am trying to build a java project and publish the resulting artifacts to the repository.
As part of the build, I am getting the below error message, some pointers on how to fix the below issue would be helpful.
Gradle Build:
$ gradle build --info
Initialized native services in: /var/lib/jenkins/.gradle/native
The client will now receive all logging from the daemon (pid: 4587). The daemon log file: /var/lib/jenkins/.gradle/daemon/4.9/daemon-4587.out.log
Starting 42nd build in daemon [uptime: 4 hrs 26 mins 46.465 secs, performance: 99%]
Using 4 worker leases.
Starting Build
Settings evaluated using settings file '/var/lib/jenkins/gradle_projects/settings.gradle'.
Projects loaded. Root project using build file '/var/lib/jenkins/gradle_projects/build.gradle'.
Included projects: [root project 'hello-world']
> Configure project :
Evaluating root project 'hello-world' using build file '/var/lib/jenkins/gradle_projects/build.gradle'.
FAILURE: Build failed with an exception.
* Where:
Build file '/var/lib/jenkins/gradle_projects/build.gradle' line: 32
* What went wrong:
A problem occurred evaluating root project 'hello-world'.
> Could not find method artifactory() for arguments [build_en65a4pmtkipo6cwvlcm8w7ky$_run_closure3#3ea141a7] on root project 'hello-world' of type org.gradle.api.Project.
* Try:
Run with --stacktrace option to get the stack trace. Run with --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 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 0s
This error is because you are trying to configure the Artifactory plugin ( artifactory block) but you did not apply the Artifactory plugin to your project.
Try to import the plugin as follow:
buildscript {
// EDIT
repositories {
// ...
jcenter()
}
dependencies {
// ...
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release" // <- this line is missing in your script
}
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.artifactory" // <-- this one is missing in your script
Refer to the plugin official documentation for full configuration examples : https://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin

Build failed with exception

My build fail when i run the ./gradlew wrapper and i receive this message:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'RxRedux'.
Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project : > io.realm:realm-gradle-plugin:4.2.0
project : > io.realm:realm-gradle-plugin:4.2.0 > io.realm:realm-transformer:4.2.0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
Your project-level build.gradle file is requesting that com.android.tools.build:gradle:3.0.1 be added to the classpath, but it does not have google() in the list of repositories.
You want that buildscript closure to look like:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
(notice the google() line)

Failed to apply plugin [class 'org.gradle.api.plugins.scala.ScalaBasePlugin']: Gradle v2.13

Trying to build my project with gradle 2.13.
Getting Error:
MUSGM186035-835:c gm$ gradle build
Version suffix : -6
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/gm/IdeaProjects/repo/a/b/c/build.gradle' line: 2
* What went wrong:
A problem occurred evaluating project ':b:c:QGInitiator'.
> Failed to apply plugin [class 'org.gradle.api.plugins.scala.ScalaBasePlugin']
> A dependency must not be empty
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
BUILD FAILED
Total time: 8.397 secs
My build.gradle file looks like,
apply plugin: 'java'
apply plugin:'scala'//Line with error
ourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile "org.scala-lang:scala-library:2.11.1"
}
This project is part of another project which has other gradle files. But I am not buling the parent project. Not sure what is happening with my dependency.
Stacktrace:
Caused by: org.gradle.api.InvalidUserDataException: A dependency must not be empty
at org.gradle.api.internal.tasks.DefaultTaskDependency.addValue(DefaultTaskDependency.java:122)
at org.gradle.api.internal.tasks.DefaultTaskDependency.add(DefaultTaskDependency.java:115)
at org.gradle.api.internal.AbstractTask$11.run(AbstractTask.java:323)
at org.gradle.api.internal.tasks.TaskMutator.mutate(TaskMutator.java:37)
at org.gradle.api.internal.AbstractTask.dependsOn(AbstractTask.java:321)
at org.gradle.plugins.ide.idea.IdeaPlugin$_configureForScalaPlugin_closure8.doCall(IdeaPlugin.groovy:229)
at org.gradle.plugins.ide.idea.IdeaPlugin$_configureForScalaPlugin_closure8.call(IdeaPlugin.groovy)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:205)
at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:165)
at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:159)
at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:142)
Try applying the idea plugin to the root plugin. I'm not exactly sure what's going on, but that should solve the issue.

Categories