小编Raj*_*pta的帖子

未找到 Gradle DSL 方法:“buildConfigField()”

我有这个 gradle 错误

错误:(21, 0) 未找到 Gradle DSL 方法:“buildConfigField()” 可能的原因:

<ul><li>The project 'Sunshine' may be using a version of Gradle that does not contain the method.

<a href="openGradleSettings">Gradle settings</a></li><li>The build file may be missing a Gradle plugin.

<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>
Run Code Online (Sandbox Code Playgroud)

我的 build.gradle 代码在这里

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.example.boxerrebellion.sunshine.app"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    buildTypes.each {
         it.buildConfigField …
Run Code Online (Sandbox Code Playgroud)

android gradle

3
推荐指数
2
解决办法
1万
查看次数

标签 统计

android ×1

gradle ×1