title: Why "Android resource linking failed" error appears when i lower the Target SDK from 28 to 27?
body: <p>I am using Whatsapp sticker source code to build my own sticker app. when i build this project with Target SDK version 28 or 29 it compiles flawless but when i lower the <em>Target SDK version to 27</em> then it **fails to link the resources.**I want this code to work on Android Oreo devices too.</p>
  
  <blockquote>
    <p>It is to be noted that Whatsapp migrated their code to <strong>Androidx</strong>
    recently.</p>
  </blockquote>
  
  <p><strong>Build.gradle:</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      //the compression of webp file during build causes problem with FileDescriptor in ContentProvider.
      aaptOptions {
          noCompress "webp"
      }
      compileSdkVersion 27
      defaultConfig {
          applicationId 'com.sticker.app'
          minSdkVersion 15
          targetSdkVersion 27
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
          def contentProviderAuthority = applicationId + ".stickercontentprovider"
          // Creates a placeholder property to use in the manifest.
          manifestPlaceholders =
                  [contentProviderAuthority: contentProviderAuthority]
          // Adds a new field for the authority to the BuildConfig class.
          buildConfigField("String",
                  "CONTENT_PROVIDER_AUTHORITY",
                  "\"${contentProviderAuthority}\"")
      }
      buildTypes {
          debug {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
          release {
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility = '1.8'
          targetCompatibility = '1.8'
      }
  
      packagingOptions {
          exclude 'lib/*/libnative-imagetranscoder.so'
          exclude 'lib/*/libnative-filters.so'
      }
  
      // Configures multiple APKs based on ABI.
      // see https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
  //    splits {
  //        abi {
  //            enable true // Enables building multiple APKs per ABI.
  //            universalApk true // Specifies that we do not want to also generate a universal APK that includes all ABIs.
  //        }
  //    }
  }
  
  task checkDebug {
      doLast {
          println("checkDebug")
          if (android.defaultConfig.applicationId.startsWith("com.whatsapp")) {
              throw new GradleException("applicationId in defaultConfig cannot start with com.whatsapp, please change your applicationId in app/build.gradle")
          }
          checkApplicationIdInDebug()
      }
  }
  
  private void checkApplicationIdInDebug() {
      Properties properties = new Properties()
      properties.load(project.rootProject.file('local.properties').newDataInputStream())
      def ignoreApplicationIdCheck = properties.getProperty('ignoreApplicationIdCheck')
      if (ignoreApplicationIdCheck == null) {
          if (android.defaultConfig.applicationId == "com.example.samplestickerapp") {
              throw new GradleException("Your applicationId is currently com.example.samplestickerapp, please change your applicationId to a different string in app/build.gradle in line 10")
          }
      } else {
          println("application id check ignored")
      }
  }
  
  
  task checkRelease {
      doLast {
          println("checkRelease")
          if (android.defaultConfig.applicationId.startsWith("com.example")) {
              throw new GradleException("applicationId in defaultConfig cannot start with com.example, please change your applicationId in app/build.gradle")
          }
      }
  }
  
  tasks.whenTaskAdded { task -&gt;
      println(task.name)
      if (task.name.contains("assembleDebug")) {
          task.dependsOn checkDebug
      }
      if (task.name.contains("assembleRelease")) {
          task.dependsOn checkRelease
      }
  }
  </code></pre>
  
  <p><strong>Build.gradle Dependencies:</strong></p>
  
  <pre><code>dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'androidx.appcompat:appcompat:1.1.0'
      implementation 'com.google.android.material:material:1.0.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.2.0'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
      implementation 'androidx.recyclerview:recyclerview:1.0.0'
      implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
      implementation 'com.facebook.fresco:fresco:2.0.0'
      implementation 'com.facebook.fresco:webpsupport:2.0.0'
      implementation 'com.facebook.fresco:animated-webp:2.0.0'
      implementation 'com.facebook.fresco:animated-base:2.0.0'
  }
  </code></pre>
  
  <p>I have searched ways to lower the Target SDK on Androidx project but haven't found any yet.</p>
  
  <p><strong>ERROR:</strong></p>
  
  <pre><code>&gt; Task :app:processDebugResources FAILED
  AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\vivek\\.gradle\\caches\\transforms-2\\files-2.1\\37ec02f661e3547c5499ecdfd9f3cd1f\\appcompat-1.1.0\\res\\values-v28\\values-v28.xml","position":{"startLine":4,"startColumn":4,"startOffset":217,"endLine":7,"endColumn":12,"endOffset":442}}],"original":"C:\\Users\\vivek\\.gradle\\caches\\transforms-2\\files-2.1\\37ec02f661e3547c5499ecdfd9f3cd1f\\appcompat-1.1.0\\res\\values-v28\\values-v28.xml:5:5-8:13: AAPT: error: resource android:attr/dialogCornerRadius not found.\n    ","tool":"AAPT"}
  AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\vivek\\.gradle\\caches\\transforms-2\\files-2.1\\37ec02f661e3547c5499ecdfd9f3cd1f\\appcompat-1.1.0\\res\\values-v28\\values-v28.xml","position":{"startLine":8,"startColumn":4,"startOffset":447,"endLine":11,"endColumn":12,"endOffset":684}}],"original":"C:\\Users\\vivek\\.gradle\\caches\\transforms-2\\files-2.1\\37ec02f661e3547c5499ecdfd9f3cd1f\\appcompat-1.1.0\\res\\values-v28\\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.\n    ","tool":"AAPT"}
  AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\vivek\\.gradle\\caches\\transforms-2\\files-2.1\\c527b78844be871c44103f6f45a963fb\\core-1.1.0\\res\\values\\values.xml","position":{"startLine":141,"startColumn":4,"startOffset":8780,"endLine":172,"endColumn":24,"endOffset":10840}}],"original":"C:\\Users\\vivek\\.gradle\\caches\\transforms-2\\files-2.1\\c527b78844be871c44103f6f45a963fb\\core-1.1.0\\res\\values\\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.\n    ","tool":"AAPT"}
  AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\vivek\\.gradle\\caches\\transforms-2\\files-2.1\\c527b78844be871c44103f6f45a963fb\\core-1.1.0\\res\\values\\values.xml","position":{"startLine":141,"startColumn":4,"startOffset":8780,"endLine":172,"endColumn":24,"endOffset":10840}}],"original":"C:\\Users\\vivek\\.gradle\\caches\\transforms-2\\files-2.1\\c527b78844be871c44103f6f45a963fb\\core-1.1.0\\res\\values\\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.\n    ","tool":"AAPT"}
  AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\vivek\\.gradle\\caches\\transforms-2\\files-2.1\\37ec02f661e3547c5499ecdfd9f3cd1f\\appcompat-1.1.0\\res\\values\\values.xml","position":{"startLine":2771,"startColumn":4,"startOffset":173278,"endLine":2794,"endColumn":24,"endOffset":174475}}],"original":"C:\\Users\\vivek\\.gradle\\caches\\transforms-2\\files-2.1\\37ec02f661e3547c5499ecdfd9f3cd1f\\appcompat-1.1.0\\res\\values\\values.xml:2772:5-2795:25: AAPT: error: resource android:attr/textFontWeight not found.\n    ","tool":"AAPT"}
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:processDebugResources'.
  &gt; A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
     &gt; Android resource linking failed
       C:\Users\vivek\.gradle\caches\transforms-2\files-2.1\37ec02f661e3547c5499ecdfd9f3cd1f\appcompat-1.1.0\res\values-v28\values-v28.xml:5:5-8:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
  
       C:\Users\vivek\.gradle\caches\transforms-2\files-2.1\37ec02f661e3547c5499ecdfd9f3cd1f\appcompat-1.1.0\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
  
       C:\Users\vivek\.gradle\caches\transforms-2\files-2.1\c527b78844be871c44103f6f45a963fb\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
  
       C:\Users\vivek\.gradle\caches\transforms-2\files-2.1\c527b78844be871c44103f6f45a963fb\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
  
       C:\Users\vivek\.gradle\caches\transforms-2\files-2.1\37ec02f661e3547c5499ecdfd9f3cd1f\appcompat-1.1.0\res\values\values.xml:2772:5-2795:25: AAPT: error: resource android:attr/textFontWeight not found.
  </code></pre>