简体   繁体   English

'sourceSets'无法应用于Android Studio中的'groovy.lang.closure'警告

[英]'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.

相关问题 &#39;sourceSets&#39;无法应用于groovy.lang.Closure <org.gradle.api.tasks.SourceSet> IntelliJ 2016中的警告 - 'sourceSets' cannot be applied to groovy.lang.Closure<org.gradle.api.tasks.SourceSet> warning in IntelliJ 2016 IntelliJ IDEA 和 Gradle - 不能应用于“(groovy.lang.Closure)” - IntelliJ IDEA and Gradle - Cannot be applied to '(groovy.lang.Closure)' 升级Android项目以使用Java8(compileOptions不能应用于groovy.lang.closure) - Upgrading Android project to use Java8 (compileOptions cannot be applied to groovy.lang.closure) 在Java应用程序中使用groovy.lang.Closure - Using groovy.lang.Closure in Java application 在ListItem中无法应用于android的java.lang.String - In ListItem cannot be applied to java.lang.String android Java构造函数无法应用于给定类型的android studio - java Constructor cannot be applied to given types android studio 毕加索无法应用于给定类型的错误Android Studio - Picasso cannot be applied to given types error Android Studio 方法toString无法应用于Android Studio中的给定类型错误 - Method toString cannot be applied to given types error in Android Studio class 中的构造函数不能应用于给定类型 android studio - constructor in class cannot be applied to given types android studio JavaPoet + Android Studio &quot;addModifiers(Modifier) 不能应用于Modifier&quot; - JavaPoet + Android Studio "addModifiers(Modifier) cannot be applied to Modifier"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM