title: Error: "Unresolved reference: versionCode" in build.gradle.kts
body: <p>I'm trying to add a new module (library module) to my project but in <code>build.gradle.kts</code> (for library module) I have this error:</p>
  <pre><code>org.gradle.internal.exceptions.LocationAwareException: Build file ' ... /build.gradle.kts' line: 13
  Script compilation errors:
  
    Line 13:         versionCode = 1
                     ^ Unresolved reference: versionCode
  
    Line 14:         versionName = &quot;1.0&quot;
                     ^ Unresolved reference: versionName
  
  .
  .
  .
  
  Caused by: ScriptCompilationException( ... )
  </code></pre>
  <p><strong>build.gradle.kts</strong></p>
  <pre class="lang-kotlin prettyprint-override"><code>plugins {
      id(&quot;com.android.library&quot;)
      id(&quot;kotlin-android&quot;)
  }
  
  android {
      compileSdk = 30
      buildToolsVersion = &quot;30.0.3&quot;
  
      defaultConfig {
          minSdk = 21
          targetSdk = 30
          versionCode = 1       //error: Unresolved reference
          versionName = &quot;1.0&quot;   //error: Unresolved reference
  
          testInstrumentationRunner = &quot;androidx.test.runner.AndroidJUnitRunner&quot;
          consumerProguardFiles(&quot;consumer-rules.pro&quot;)
      }
  
      buildTypes {
          release {
              isMinifyEnabled = false
              proguardFiles(
                  getDefaultProguardFile(&quot;proguard-android-optimize.txt&quot;),
                  &quot;proguard-rules.pro&quot;
              )
          }
      }
      compileOptions {
          sourceCompatibility = JavaVersion.VERSION_1_8
          targetCompatibility = JavaVersion.VERSION_1_8
      }
      kotlinOptions {
          jvmTarget = &quot;1.8&quot;
      }
  }
  </code></pre>
  <p>I would be grateful for any help</p>