我使用的是安卓studio.This,这是我在构建gradle时突然遇到的错误。早些时候它工作正常。我关闭了android工作室,重新建造了gradle。但不能修复错误。我清理并重建了谷仓。
你能解决这个问题吗。
Error:org.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotter$FileCollectionSnapshotImpl cannot be cast to org.gradle.api.internal.changedetection.state.OutputFilesCollectionSnapshotter$OutputFilesSnapshot
造成此意外错误的可能原因包括:
对于损坏的Gradle进程,您还可以尝试关闭IDE,然后杀死所有Java进程。
下面显示我的build.gradle信息
构建:gradle:1.5.0‘pply plugin:'com.android.application’compileSdkVersion 23 buildToolsVersion "23.0.2“minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0”
发布于 2016-05-13 04:17:02
也许找不到格雷德尔。尝试更改gradle版本,并使用gradle版本更新它,如项目中所示:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
及其在gradle模块中的实现:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.yourproject"
minSdkVersion 15
targetSdkVersion 23
versionCode 14
versionName '1.4'
}
https://stackoverflow.com/questions/37201115
复制相似问题