title: Gradle sync failed: Could not find method buildConfigField() android studio
body: <p>I am working on an online course and i had problem with this code </p>
  
  <pre><code>buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
      buildTypes.each {
          it.buildConfigField 'String', 'b35f87cc72b82388ed9276e41fd55dd0', DARK_SKY_KEY
          it.buildConfigField 'String', 'b35f87cc72b82388ed9276e41fd55dd0', FLICKR_API_KEY
      }
  }
  </code></pre>
  
  <p>but i got error like below:</p>
  
  <pre><code>Error:(22, 0) Could not find method buildConfigField() for arguments [String, b35f87cc72b82388ed9276e41fd55dd0, BuildType_Decorated{name=DARK_SKY_KEY, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}}] on BuildType_Decorated{name=debug, debuggable=true, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=SigningConfig_Decorated{name=debug, storeFile=C:\Users\pc\.android\debug.keystore, storePassword=android, keyAlias=AndroidDebugKey, keyPassword=android, storeType=C:\Users\pc\.android\debug.keystore, v1SigningEnabled=true, v2SigningEnabled=true}, embedMicroApp=false, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}} of type com.android.build.gradle.internal.dsl.BuildType.
  &lt;a href="openFile:C:\Users\pc\Desktop\Weather-master\app\build.gradle"&gt;Open File&lt;/a&gt;
  </code></pre>