Reputation: 39539
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.
Upvotes: 4
Views: 4720
Reputation: 15327
I solve it by the following steps
delete the follwing folders
appName/build
appName/app/build
appName/.gradle
run android studio then go to build
> rebuild project
hope this work with you
Upvotes: 2
Reputation: 21748
The error of this type can be fixed by changing
plusConfigurations += project.configurations.compile
To:
plusConfigurations += [ project.configurations.compile ]
Upvotes: 5
Reputation: 131
As per Ales above, updating to 1.9.17 resolved this for me. I was on 1.9.7 previously.
Specifically, in any appengine projects that you have included, update the versions in your build.gradle file for both the buildscript dependencies and general dependencies. I 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'
Upvotes: 2
Reputation: 31
Had the same issue. I have appengine module in project. Updating gradle config for it to 1.9.17 solved it for me
Upvotes: 3