将一个项目更新为新的gradle-plugin(14.0.2)后,我在Android-Studio中遇到问题:
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.
我尝试了所有建议但没有成功.此项目在控制台上构建良好 – 有点卡在这里.任何提示都可以提供帮助.
解决方法:
可以通过更改来修复此类错误
plusConfigurations += project.configurations.compile
至:
plusConfigurations += [ project.configurations.compile ]