Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle build process is failing

My project was successfully building and all of a sudden I got the below error in Android studio.

Unable to find method 'org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal.getPublishableFiles()Lorg/gradle/api/file/FileCollection;'. 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.

I tried clearing the local dependency cache and rebuilding the project. But still the error persists. I am using android studio v4.0 with build tools v29.0.2.

Is it because gradle can't download the dependency from maven repo? Is it because there is an error in configuring maven in my 'respositories' list? How can I get more information on this error?

like image 351
davidvarghese Avatar asked Jun 04 '20 07:06

davidvarghese


People also ask

Why is my Gradle build failing?

If gradle --version works, but all of your builds fail with the same error, it is possible there is a problem with one of your Gradle build configuration scripts. You can verify the problem is with Gradle scripts by running gradle help which executes configuration scripts, but no Gradle tasks.

How do I resolve errors in build Gradle?

Solution: Go in File -> Project Structure -> Project Settings -> Project and set Project SDK to Android API 30 Platform (or the latest). Go in File -> Project Structure -> Project Settings -> Modules and select the Dependencies tab and choose Android API 30 Platform in the Module SDK dropdown.

How do I debug a Gradle build?

To do that, just pick the Gradle Remote Debug configuration and then click the Debug icon on the project to be debugged. For more info, you can read the Gradle documentation. Follow us for more productivity tools & ideas for Android, Kotlin & Gradle projects.

How do you clean Gradle?

If you wish to clean (empty) the build directory and do a clean build again, you can invoke a gradle clean command first and then a gradle assemble command. Now, fire the gradle assemble command and you should have a JAR file that is named as <name>-<version>.

Why does my Gradle build fail?

One of the most common root causes for build failures is a changed upstream binary dependency that is specified to resolve dynamically. Using Gradle Enterprise’s comparison feature is especially helpful in finding such failures. Bring up the Gradle Enterprise scan list by clicking here.

What is the best practice for deploying Gradle enterprise?

The best practice for deploying Gradle Enterprise is that all builds send build scans to the centralized Gradle Enterprise server. CI servers do preserve logs of failed CI builds, but the team is almost entirely blind to failures that occur in developer builds typically.

Why is Gradle--version not working?

Other installation failures If gradle --version works, but all of your builds fail with the same error, it is possible there is a problem with one of your Gradle build configuration scripts. You can verify the problem is with Gradle scripts by running gradle help which executes configuration scripts, but no Gradle tasks.

How to detect deprecation of Gradle features?

Run with --scan to get full insights. Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings.


1 Answers

Try to update the com.jfrog.artifactory version.

like image 63
disha4mourya Avatar answered Nov 15 '22 00:11

disha4mourya