Java.io.File cannot be added to org.gradle.api.artifacts.Configuration
I got a problem in Android-Studio after updating one project to a 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 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 have tried all the suggested things but have no success. Also this project builds nicely on the console - stuck here. Any hint can help.
+3
source to share
4 answers
As per Ales above, upgrading to 1.9.17 resolved this for me. I was on 1.9.7 earlier.
Specifically, in any appengine projects you have included, update the versions in your build.gradle file for both buildscript dependencies and general dependencies. I have updated for:
buildscript dependencies:
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.17'
dependencies:
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.17'
compile 'com.google.appengine:appengine-api-1.0-sdk:1.9.17'
compile 'com.google.appengine:appengine-endpoints:1.9.17'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.17'
+2
source to share