title: Resource drawable not found but they exist in drawable folder
body: <p>I'm working on an android application for about 2 months. Almost each time I created custom drawable when I tried to build project I got Android resource linking failed error and after that the name of drawables that couldn't located by android studio.</p>
  
  <p>My solution was that I moved those drawables somewhere out of my project and rebuild the the app after getting error I moved drawables again back to my project and when I rebuild my <code>APK</code> there was no error anymore and I could build, run, even generate <code>APK</code> and those drawables worked perfectly fine. But now that my project finished I want generate signed apk but there is no way that I can get rid of Android resource linking failed error.
  I put some of my drawables codes below.</p>
  
  <p><code>retry_btn.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:state_enabled="false" android:drawable="@drawable/register_btn_disabled"/&gt;
      &lt;item android:state_pressed="true" android:drawable="@drawable/register_btn_clicked"/&gt;
      &lt;item android:state_pressed="false" android:drawable="@drawable/register_btn_normal"/&gt;
      &lt;item android:drawable="@drawable/register_btn_normal"/&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p><code>story_box.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;stroke android:color="#70707070" android:width="1dp"/&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p><code>table_border.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt;
          &lt;item&gt;
              &lt;shape
          android:shape="rectangle"&gt;
                  &lt;stroke android:width="1dp" android:color="#333333" /&gt;
                  &lt;solid android:color="#EEEEEE" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>All the drawables are available in my project but I get this output when I try to generate signed apk:</p>
  
  <blockquote>
    <p>Android resource linking failed<br></p>
    
    <blockquote>
      <p>Output:  C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\src\main\res\layout\activity_main.xml:51: error: resource drawable/search (aka uk.MyAppName.www.MyAppName:drawable/search) not found.<br>
      C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\src\main\res\layout\activity_movie.xml:234: error: resource drawable/story_box (aka uk.MyAppName.www.MyAppName:drawable/story_box) not found.<br>
      C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\src\main\res\layout\activity_no_internet.xml:49: error: resource drawable/retry_btn (aka uk.MyAppName.www.MyAppName:drawable/retry_btn) not found.<br>
      C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\src\main\res\layout\activity_register.xml:205: error: resource drawable/register_btn (aka uk.MyAppName.www.MyAppName:drawable/register_btn) not found.<br>
      C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\src\main\res\layout\activity_register.xml:215: error: resource drawable/register_btn (aka uk.MyAppName.www.MyAppName:drawable/register_btn) not found.<br>
      C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\src\main\res\layout\activity_search.xml:39: error: resource drawable/search (aka uk.MyAppName.www.MyAppName:drawable/search) not found.<br>
      C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\src\main\res\layout\search_table_item.xml:2: error: resource drawable/table_border (aka uk.MyAppName.www.MyAppName:drawable/table_border) not found.<br>
      C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\src\main\res\layout\table_item.xml:2: error: resource drawable/table_border (aka uk.MyAppName.www.MyAppName:drawable/table_border) not found.<br>
      error: failed linking file resources.<br></p>
      
      <p>Command: C:\Users\MyUser.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\ac5e520165d725772f5386c054776ce5\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\<br>
              C:\Users\MyUser\AppData\Local\Android\Sdk\platforms\android-28\android.jar\<br>
              --manifest\<br>
              C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\build\intermediates\merged_manifests\release\processReleaseManifest\merged\AndroidManifest.xml\<br>
              -o\<br>
              C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\build\intermediates\processed_res\release\processReleaseResources\out\resources-release.ap_\<br>
              -R\<br>
              @C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\build\intermediates\incremental\processReleaseResources\resources-list-for-resources-release.ap_.txt\<br>
              --auto-add-overlay\<br>
              --java\<br>
              C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\build\generated\not_namespaced_r_class_sources\release\processReleaseResources\r\<br>
              --proguard\<br>
              C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\build\intermediates\proguard-rules\release\aapt_rules.txt\<br>
              --custom-package\<br>
              uk.MyAppName.www.MyAppName\<br>
              -0\<br>
              apk\<br>
              --output-text-symbols\<br>
              C:\Users\MyUser\AndroidStudioProjects\MyAppName\app\build\intermediates\symbols\release\R.txt\<br>
              --no-version-vectors<br>
      Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0</p>
    </blockquote>
  </blockquote>
  
  <p>this is my gradle file:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  apply plugin: 'kotlin-android'
  
  apply plugin: 'kotlin-android-extensions'
  
  android {
      compileSdkVersion 28
      defaultConfig {
          applicationId "uk.MyAppName.www.MyAppName"
          minSdkVersion 21
          targetSdkVersion 28
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
  //            minifyEnabled false
  //            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      productFlavors {
      }
  }
  
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
      implementation 'com.android.support:support-v4:28.0.0'
      implementation 'com.android.support:appcompat-v7:28.0.0'
      implementation 'com.android.support:exifinterface:28.0.0'
      implementation 'com.android.support.constraint:constraint-layout:1.1.3'
      implementation 'com.android.support:design:28.0.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.2'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
      implementation 'com.android.support:recyclerview-v7:28.0.0'
      implementation 'com.android.support:support-v4:28.0.0'
      implementation 'com.android.support:cardview-v7:28.0.0'
      implementation 'org.jetbrains.anko:anko-commons:0.10.4'
      implementation 'com.squareup.picasso:picasso:2.71828'
      implementation 'com.google.android.exoplayer:exoplayer:2.9.1'
  }
  </code></pre>