[英]'sourceSets' cannot be applied to 'groovy.lang.closure' warning in Android Studio
I've created a new AndroidStudio project using the libGDX generator. 我使用libGDX生成器创建了一个新的AndroidStudio项目。 When I import the project into AndroidStudio using the
build.gradle
file, I get a warning while editing build.gradle file 当我使用
build.gradle
文件将项目导入AndroidStudio时,我在编辑build.gradle文件时收到警告
'sourceSets' cannot be applied to 'groovy.lang.closure'
Here is the section that gives the warning: 以下是给出警告的部分:
android {
buildToolsVersion "23.0.2"
compileSdkVersion 23
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
instrumentTest.setRoot('tests')
}
defaultConfig {
applicationId "com.twocrowstudios.rpggame"
minSdkVersion 9
targetSdkVersion 23
}
}
Just the sourceSets section is generating this error. 只是sourceSets部分正在生成此错误。 What does this error mean?
这个错误是什么意思? It seems that all my builds work fine.
似乎我的所有版本都运行良好。 While there have been some other questions relating to the build section, this question pertains to the sourceSet section which has not been addressed.
虽然还有一些与构建部分有关的其他问题,但这个问题与sourceSet部分有关,该部分尚未解决。
There was long term bug IDEA-159224
which is still not completely fixed (as of 162.1628 build) . 有一个长期的错误
IDEA-159224
仍然没有完全修复(从162.1628版本) 。
You can suppress this warning locally using comment //noinspection GroovyAssignabilityCheck
or turn off Incompatible type assignment
inspection (not recommended). 您可以使用注释
//noinspection GroovyAssignabilityCheck
在本地禁止此警告,或者关闭Incompatible type assignment
检查(不推荐)。
Anyway I'd suggest you to vote for this issue to attract developers attention to this problem. 无论如何,我建议你投票支持这个问题,以吸引开发人员注意这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.