Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.io.File cannot be cast to org.gradle.api.artifacts.Configuration

I have a problem in Android-Studio after updating one project to the new gradle-plugin ( 14.0.2):

Error:Cause: java.io.File cannot be cast to org.gradle.api.artifacts.Configuration
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process may be corrupt.
<a href="stopGradleDaemons">Stop Gradle daemons and sync project</a></li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

I tried all suggested things but no success. Also this project builds fine on the console - kinda stuck here. Any hint could help.

like image 226
ligi Avatar asked Dec 15 '22 18:12

ligi


2 Answers

The error of this type can be fixed by changing

plusConfigurations += project.configurations.compile

To:

plusConfigurations += [ project.configurations.compile ]
like image 149
Audrius Meškauskas Avatar answered May 23 '23 08:05

Audrius Meškauskas


Had the same issue. I have appengine module in project. Updating gradle config for it to 1.9.17 solved it for me

like image 45
Aleš Kracík Avatar answered May 23 '23 08:05

Aleš Kracík