小编Apo*_*lli的帖子

错误:Gradle 同步失败:无法获取 DefaultConfig_Decolated 的未知属性“API_KEY”

错误:无法获取 DefaultConfig_Decolated{name=main、dimension=null、minSdkVersion=null、targetSdkVersion=null、renderscriptTargetApi=null、renderscriptSupportModeEnabled=null、renderscriptSupportModeBlasEnabled=null、renderscriptNdkModeEnabled=null、versionCode=null、versionName 的未知属性“API_KEY” =null、applicationId=null、testApplicationId=null、testInstrumentationRunner=null、testInstrumentationRunnerArguments={}、testHandleProfiling=null、testFunctionalTest=null、signingConfig=null、resConfig=null、mBuildConfigFields={}、mResValues={}、mProguardFiles=[] 、mConsumerProguardFiles=[]、mManifestPlaceholders={}、mWearAppUnbundled=null},类型为 com.android.build.gradle.internal.dsl.DefaultConfig。应用插件:'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.2'
    defaultConfig {
        buildConfigField("String", "API_KEY", API_KEY)        //error here
        buildConfigField("String", "ER_API_KEY", ER_API_KEY)
        applicationId "com.gpads.gautham.imagetotextanalysis"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 2
        versionName "2.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    // ... other values
}
Run Code Online (Sandbox Code Playgroud)

java android gradle android-studio build.gradle

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

标签 统计

android ×1

android-studio ×1

build.gradle ×1

gradle ×1

java ×1