Build failed with exception - java

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)

Related

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Could not find com.github.adrielcafe:ffmpeg-android-java:2a627f6ecd

Here is my console.
I can't get com.github.adrielcafe:ffmpeg-android-java:2a627f6ecd.Is it my fault?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.adrielcafe:ffmpeg-android-java:2a627f6ecd.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/adrielcafe/ffmpeg-android-java/2a627f6ecd/ffmpeg-android-java-2a627f6ecd.pom
- https://jcenter.bintray.com/com/github/adrielcafe/ffmpeg-android-java/2a627f6ecd/ffmpeg-android-java-2a627f6ecd.pom
- http://download.flutter.io/com/github/adrielcafe/ffmpeg-android-java/2a627f6ecd/ffmpeg-android-java-2a627f6ecd.pom
- http://maven.aliyun.com/nexus/content/groups/public/com/github/adrielcafe/ffmpeg-android-java/2a627f6ecd/ffmpeg-android-java-2a627f6ecd.pom
- http://sczpkj.f3322.net:8082/artifactory/android/com/github/adrielcafe/ffmpeg-android-java/2a627f6ecd/ffmpeg-android-java-2a627f6ecd.pom
- https://storage.flutter-io.cn/download.flutter.io/com/github/adrielcafe/ffmpeg-android-java/2a627f6ecd/ffmpeg-android-java-2a627f6ecd.pom
- https://repo.maven.apache.org/maven2/com/github/adrielcafe/ffmpeg-android-java/2a627f6ecd/ffmpeg-android-java-2a627f6ecd.pom
- https://maven.aliyun.com/repository/google/com/github/adrielcafe/ffmpeg-android-java/2a627f6ecd/ffmpeg-android-java-2a627f6ecd.pom
- https://maven.aliyun.com/repository/public/com/github/adrielcafe/ffmpeg-android-java/2a627f6ecd/ffmpeg-android-java-2a627f6ecd.pom
- https://jitpack.io/com/github/adrielcafe/ffmpeg-android-java/2a627f6ecd/ffmpeg-android-java-2a627f6ecd.pom
Required by:
project :app > project :flutter_plugin_record > com.github.adrielcafe:AndroidAudioConverter:0.0.8
* 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
Here is my android\build.gradle
buildscript {
repositories {
google()
jcenter()
maven { url "http://download.flutter.io" }
maven {url 'http://maven.aliyun.com/nexus/content/groups/public/'}
}
dependencies {
// classpath 'com.android.tools.build:gradle:3.5.0'
// classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:4.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "http://download.flutter.io" }
maven {url 'http://maven.aliyun.com/nexus/content/groups/public/'}
// maven {
// url 'http://download.flutter.io'
// }
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Delete .idea folder inside your project and reboot your Android Studio

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

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.

Gradle exception

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

Categories