Pablo
Pablo

Reputation: 1141

android studio failed to sync gradle project

I'm trying to build a cordova app. But when I try to build it, I get this error message:

Error:Cause: org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection 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'm actually new to android development, and I'm quite lost.

Hope someone can guide me through this issue.

Upvotes: 2

Views: 2690

Answers (1)

Hexise
Hexise

Reputation: 1568

If you are using Android Studio, from Android project explorer, find gradle-wrapper.properties, open it, change the distributionUrl line, such as following(2.14.1 is just an example):

distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip

Then build again, this may solve this problem.

Upvotes: 1

Related Questions