Build Error in Android Studio 2.1.3 - java

I am using android studio 2.1.3. I am getting the following error, in spite of clearing the project and rebuilding it again, restarting etc... How to solve it?
Error:Execution failed for task :app:transformClassesWithJavaResourcesVerifierForDebug.
org.gradle.api.internal.changedetection.rules.DescriptiveChange cannot be cast to org.gradle.api.tasks.incremental.InputFileDetails
ay 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.

Thanks.
I am using Windows 8.1
I tried deleting the folder .gradle in the application folder. Then I cleaned the project and build it again. IT WORKS FINE NOW.

Have you cleaned your project through terminal ?
If not use ./gradlew clean this from root project.
Also check your gradle files, Is everything is up-to-date and correctly written there. Check for dependencies also.

Related

Error:failed while loading project Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

getting Gradle's dependency cache may be corrupt error.
[Unable to find method 'org.gradle.api.file.ProjectLayout.fileProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/RegularFileProperty;'
org.gradle.api.file.ProjectLayout.fileProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/RegularFileProperty;
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.
][2]

I try to add Volley library but every time show me this error

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 that is not compatible with the other plugins in the project or the version of the 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.

Intellij Idea error while importing projet from Android studio

I am getting following error while importing project from Android Studio to Intellij Idea Professional Edition. I tried adding JAXB by importing externally but didn't work.
Unable to load class 'javax.xml.bind.JAXBException'. 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.
my gradle-wrapper.properties :
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
The error means that in Java 12 JAXB has been removed or not compatible, I have solved the exact problem by reverting back my jdk from jdk 12 to jdk 8. Hope it helps.

Error:Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.2.1-bin.zip'

I'm in the process of upgrading the gradle version in a project from 1.7 to 4.2.1. I have set Intellij to import the gradle project but when I click Refresh all Gradle projects i get the following error
Gradle 'trunk-gradle-uplift' project refresh failed
Error:Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.2.1-bin.zip'.
I have tried deleting everything in my %USER_HOME%/.gradle directory
Deleting the .gradle directory in the project.
Invalidating caches and restarting Intellij.
Any ideas how to fix this or even get some debug output as to why it failed?
Not entirely sure what the issue was down to but uninstalling Intellij 2017.2.1 and installing Intellij 2017.2.5 seems to have fixed the issue

ClassNotFoundException: org.gradle.logging.StyledTextOutput$Style

I'm trying to build my android app using Android Studio and I keep getting the Gradle Sync error
Error: Unable to load class 'org.gradle.logging.StyledTextOutput$Style'.
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.
Over the course of the past few hours I've restarted gradle, uninstalled it, installed multiple different versions but I cannot seem to get the project to build for the life of me.
Some of my research has said that gradle 3.0.0 has fixed this problem but, I'm currently building using gradle 3.3.
Research sources:
https://github.com/KeepSafe/dexcount-gradle-plugin/issues/123
https://github.com/KeepSafe/dexcount-gradle-plugin/issues/124

Categories

Resources