[英]Gradle is build with errors in android studio
I am using android studio.This is the error suddenly I got when building gradle. 我正在使用android studio。这是构建gradle时突然出现的错误。 Earlier it was working correctly.
之前它工作正常。 I close the android studio and re-build the gradle.
我关闭了android studio并重新构建了gradle。 But doesn't fix the error.
但是并不能解决错误。 I clean and rebuild the gradle.
我清理并重建gradle。
Can you solve the problem. 您能解决问题吗?
Error:org.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotter$FileCollectionSnapshotImpl cannot be cast to org.gradle.api.internal.changedetection.state.OutputFilesCollectionSnapshotter$OutputFilesSnapshot
Possible causes for this unexpected error include: 此意外错误的可能原因包括:
Following display my build.gradle information 以下显示我的build.gradle信息
classpath 'com.android.tools.build:gradle:1.5.0' pply plugin: 'com.android.application' compileSdkVersion 23 buildToolsVersion "23.0.2" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" classpath'com.android.tools.build:gradle:1.5.0'pply插件:'com.android.application'compileSdkVersion 23 buildToolsVersion“ 23.0.2” minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName“ 1.0”
Gradle may be not found. 找不到摇篮。 Try to change gradle version and update it with your gradle version like in project :
尝试更改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()
}
}
and this one in module of gradle : 和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'
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.