title: How to fix "Android resource linking failed" error in Android Studio?
body: <p>I just started learning and working with &quot;Android Studio&quot; software and editing a project. It took too long to figure out how to work with that. I just fixed many errors and now i know many thing about errors but one thing happened to me and it's making me crazy!
  I can't fix this error and don't know what is wrong with that. This is Error:</p>
  <pre><code>&gt; Task :app:processReleaseResources FAILED
  AGPBI: {&quot;kind&quot;:&quot;error&quot;,&quot;text&quot;:&quot;Android resource linking failed&quot;,&quot;sources&quot;:[{&quot;file&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml&quot;}],&quot;original&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml: AAPT: error: style attribute 'android:attr/contextPopupMenuStyle' not found.\n    &quot;,&quot;tool&quot;:&quot;AAPT&quot;}
  AGPBI: {&quot;kind&quot;:&quot;error&quot;,&quot;text&quot;:&quot;Android resource linking failed&quot;,&quot;sources&quot;:[{&quot;file&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml&quot;}],&quot;original&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml: AAPT: error: style attribute 'android:attr/contextPopupMenuStyle' not found.\n    &quot;,&quot;tool&quot;:&quot;AAPT&quot;}
  AGPBI: {&quot;kind&quot;:&quot;error&quot;,&quot;text&quot;:&quot;Android resource linking failed&quot;,&quot;sources&quot;:[{&quot;file&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml&quot;}],&quot;original&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml: AAPT: error: style attribute 'android:attr/contextPopupMenuStyle' not found.\n    &quot;,&quot;tool&quot;:&quot;AAPT&quot;}
  AGPBI: {&quot;kind&quot;:&quot;error&quot;,&quot;text&quot;:&quot;Android resource linking failed&quot;,&quot;sources&quot;:[{&quot;file&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml&quot;}],&quot;original&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml: AAPT: error: style attribute 'android:attr/contextPopupMenuStyle' not found.\n    &quot;,&quot;tool&quot;:&quot;AAPT&quot;}
  AGPBI: {&quot;kind&quot;:&quot;error&quot;,&quot;text&quot;:&quot;Android resource linking failed&quot;,&quot;sources&quot;:[{&quot;file&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml&quot;}],&quot;original&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml: AAPT: error: style attribute 'android:attr/dialogCornerRadius' not found.\n    &quot;,&quot;tool&quot;:&quot;AAPT&quot;}
  AGPBI: {&quot;kind&quot;:&quot;error&quot;,&quot;text&quot;:&quot;Android resource linking failed&quot;,&quot;sources&quot;:[{&quot;file&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml&quot;}],&quot;original&quot;:&quot;C:\\Users\\****\\.gradle\\caches\\transforms-2\\files-2.1\\b635fd2d4b36b21da676271add72c19b\\material-1.4.0-alpha01\\res\\values\\values.xml: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.\n    &quot;,&quot;tool&quot;:&quot;AAPT&quot;}
  
  Execution failed for task ':app:processReleaseResources'.
  &gt; A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
     &gt; Android resource linking failed
       C:\Users\****\.gradle\caches\transforms-2\files-2.1\b635fd2d4b36b21da676271add72c19b\material-1.4.0-alpha01\res\values\values.xml: AAPT: error: style attribute 'android:attr/contextPopupMenuStyle' not found.
  </code></pre>
  <p>File which addressed in error text is out of my project folder and sure it is a Cached folder for gradle! Tried to clear caches, rebuilding project, deleting code lines from files, etc. nothing works!
  Hope someone can help me about this.</p>
  <p>And my &quot;build.gradle&quot; file's codes is:</p>
  <pre><code>apply plugin: 'com.android.application'
  
  android {
  
      compileSdkVersion 21
      buildToolsVersion '29.0.3'
  
      defaultConfig {
          applicationId &quot;com.troup.platform&quot;
          minSdkVersion 19
          targetSdkVersion 21
          versionCode 78
          versionName '5.7'
          multiDexEnabled true
          vectorDrawables.useSupportLibrary = true
      }
  
      dexOptions {
  
          jumboMode true
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      lintOptions {
          checkReleaseBuilds false
          // Or, if you prefer, you can continue to check for errors in release builds,
          // but continue the build even when errors are found:
          abortOnError false
      }
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  
      productFlavors {
      }
      ndkVersion '22.0.7026061'
  }
  
  dependencies {
      implementation  fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'com.android.volley:volley:1.1.1'
      implementation 'com.github.chrisbanes.photoview:library:1.2.4'
      implementation 'com.facebook.android:facebook-android-sdk:5.15.3'
      implementation 'com.mikhaellopez:circularimageview:3.2.0'
      implementation 'com.squareup.okhttp:okhttp:2.7.5'
      implementation 'com.github.bumptech.glide:glide:4.12.0'
      implementation 'androidx.appcompat:appcompat:1.2.0'
      implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
      implementation 'androidx.mediarouter:mediarouter:1.2.2'
      implementation 'androidx.browser:browser:1.3.0'
      implementation 'com.google.android.material:material:1.3.0'
      implementation 'androidx.recyclerview:recyclerview:1.1.0'
      implementation 'androidx.cardview:cardview:1.0.0'
      implementation 'com.balysv:material-ripple:1.0.2'
      implementation 'com.squareup.picasso:picasso:2.71828'
      implementation 'com.google.firebase:firebase-core:18.0.2'
      implementation 'com.google.firebase:firebase-ads:19.7.0'
      implementation 'com.google.firebase:firebase-messaging:21.0.1'
      implementation 'com.google.firebase:firebase-analytics:18.0.2'
      implementation 'com.google.android.gms:play-services-gcm:17.0.0'
      implementation 'com.google.android.gms:play-services-ads:19.7.0'
      implementation 'com.google.android.gms:play-services-location:18.0.0'
      implementation 'com.google.android.gms:play-services-auth:19.0.0'
      implementation 'com.android.billingclient:billing:3.0.2'
      implementation 'com.google.android.exoplayer:exoplayer:2.7.2'
      implementation 'androidx.multidex:multidex:2.0.1'
      implementation 'androidx.appcompat:appcompat:1.2.0'
      implementation 'androidx.exifinterface:exifinterface:1.3.2'
      implementation &quot;com.google.android.material:material:1.4.0-alpha01&quot;
  
      implementation  files('libs/YouTubeAndroidPlayerApi.jar')
  }
  dependencies {
      implementation 'com.android.support:appcompat-v7:+'
  }
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  <ul>
  <li>OS: Windows 10</li>
  <li>Android Studio Version: 4.1.2</li>
  </ul>