Android studio 错误整理

来源:互联网 发布:迅捷贝软件 编辑:程序博客网 时间:2024/05/17 23:48
Error:org.gradle.api.internal.changedetection.state.FileCollectionSnapshotImpl cannot be cast to org.gradle.api.internal.changedetection.state.OutputFilesCollectionSnapshotter$OutputFilesSnapshot
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 (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>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.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processess

原因:跑程序时说VM中OOM了,于是我把AS重启,结果一打开就报这个错误;

由于也是刚使用 Android Sutdio 更新到2.0后不久,对很多错误还不是特别熟悉,出现这个错误后,想尽了无数办法,删工程、重建、删缓存,clean了 无数次 rebuild了无数次,还是没用,于是我想到这跟 Android Studio 工具本身应该是没有关系了,于是我想到了.android 和.gradle,根据错误提示,我觉得有可能是.gradle 出现问题了,一不做二不休直接把.gradle 文件夹删了(该两文件夹一般在电脑的用户文件夹下),这个文件会自动生成,可是干掉之后就是然并卵。

解决方法:把项目的.gradle文件删除,就ok 了,白白浪费了一个小时在这上面。

现将其记录下来,谨以此为鉴。


0 0