title: Android resource linking failed - AAPT: error: resource android:attr/dialogCornerRadius not found
body: <p>I am receiving errors when trying to bundle an android release for a react-native project. This project should be converted to AndroidX as a note.</p>
  
  <h3>Error Messages</h3>
  
  <p>When trying to build a release build for Android I receive the following errors:</p>
  
  <pre><code>    * What went wrong:
  Execution failed for task ':react-native-vector-icons:verifyReleaseResources'.
  &gt; A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
     &gt; 1 exception was raised by workers:
       com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
       /Users/.../.gradle/caches/transforms-2/files-2.1/5c74eb36d229b35abeeb690f5d3b91a3/appcompat-1.0.0/res/values-v28/values-v28.xml:5:5-8:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
  
       /Users/.../.gradle/caches/transforms-2/files-2.1/5c74eb36d229b35abeeb690f5d3b91a3/appcompat-1.0.0/res/values-v28/values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
  
       /Users/.../.gradle/caches/transforms-2/files-2.1/f54ae08833e39bf2b75fd420ffea65b9/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
  
       /Users/.../.gradle/caches/transforms-2/files-2.1/f54ae08833e39bf2b75fd420ffea65b9/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.
  </code></pre>
  
  <h3>Root Build.gradle file</h3>
  
  <pre><code>buildscript {
    ext {
      buildToolsVersion = "28.0.3"
      minSdkVersion = 16
      compileSdkVersion = 28
      targetSdkVersion = 28
      supportLibVersion = "28.0.0-alpha1"
      reactNativeVersion = "0.59.9"
    }
      repositories {
          jcenter()
           google()
          maven {
            url 'https://maven.google.com/'
            name 'Google'
          }
      }
      dependencies {
          classpath('com.android.tools.build:gradle:3.6.3')
          classpath 'com.google.gms:google-services:4.2.0'
  
          // Add the Crashlytics Gradle plugin.
          classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
      }
  }
  
  allprojects {
      repositories {
          google()
          mavenLocal()
          maven {
              url 'https://maven.google.com/'
              name 'Google'
          }
          maven {
              // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
              url  "$rootDir/../node_modules/react-native/android"
          }
          // React native video - exoplayer missing from google repos, temp fix
          maven {
            url "https://google.bintray.com/exoplayer/"
          }
          jcenter()
      }
  }
  
  ext {
      buildToolsVersion = "28.0.3"
      minSdkVersion = 16
      compileSdkVersion = 28
      targetSdkVersion = 28
      supportLibVersion = "28.0.0-alpha1"
      reactNativeVersion = "0.59.9"
    }
  
  subprojects {
    afterEvaluate {project -&gt;
      if (project.hasProperty("android")) {
        android {
          compileSdkVersion compileSdkVersion
          buildToolsVersion "$buildToolsVersion"
        }
      }
    }
  }
  </code></pre>
  
  <h3>App build.gradle file</h3>
  
  <p>dependencies</p>
  
  <pre><code>dependencies {
      implementation project(':react-native-safe-area-context')
    implementation 'com.android.support:support-annotations:28.0.3'
    implementation "androidx.annotation:annotation:1.1.0"
    implementation project(':react-native-video')
      implementation(project(":react-native-google-signin"))
    implementation project(':react-native-splash-screen')
    implementation project(':react-native-iap')
    implementation project(':react-native-version-check')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-linear-gradient')
    implementation(project(':react-native-firebase')) {
          transitive = false
      }
    implementation project(':react-native-fbsdk')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-fbsdk')
    implementation project(':react-native-vector-icons')
      // react-native-google-signin
  
      // react-native-fbsdk
    implementation 'com.facebook.android:facebook-android-sdk:4.33.0'
    implementation project(':react-native-fbsdk')
  
      // RNFirebase required dependencies
      implementation "com.google.firebase:firebase-core:16.0.9"
      implementation "com.google.android.gms:play-services-base:17.0.0"
  
      // RNFirebase optional dependencies
      implementation "com.google.firebase:firebase-auth:17.0.0"
      implementation "com.google.firebase:firebase-database:16.0.5"
      implementation "com.google.firebase:firebase-firestore:17.1.4"
  
      implementation fileTree(dir: "libs", include: ["*.jar"])
      implementation 'androidx.appcompat:appcompat:1.0.0'
      implementation ("com.facebook.react:react-native:0.59.9") {force = true}  // From node_modules
  
      implementation 'com.google.firebase:firebase-crashlytics:17.0.1'
  }
  </code></pre>
  
  <h3>Research</h3>
  
  <p>I have seen some other issues of this being reported such as:<br>
  <a href="https://stackoverflow.com/questions/54792902/react-nativeandroid-aapt-error-resource-androidattr-dialogcornerradius-not">React-native(android) AAPT: error: resource android:attr/dialogCornerRadius not found</a><br>
  <a href="https://fincoapps.com/error-resource-androidattr-dialogcornerradius-not-found/" rel="noreferrer">https://fincoapps.com/error-resource-androidattr-dialogcornerradius-not-found/</a>. </p>
  
  <p>However, these look to be setup as you'd expect. One issue suggests the subprojects edit that exists in the root build.gradle file, but the same error messages always occur. </p>
  
  <h3>Edit</h3>
  
  <p>gradle-wrapper.properties</p>
  
  <pre><code>#Thu May 07 14:26:41 BST 2020
  distributionBase=GRADLE_USER_HOME
  distributionPath=wrapper/dists
  android.enableJetifier=true
  zipStoreBase=GRADLE_USER_HOME
  zipStorePath=wrapper/dists
  distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
  android.useAndroidX=true
  </code></pre>
  
  <p>React-native info</p>
  
  <pre><code>npmPackages:
    react: ^16.7.0 =&gt; 16.13.1 
    react-native: 0.59.9 =&gt; 0.59.9 
  npmGlobalPackages:
    react-native-cli: 2.0.1
  </code></pre>