title: Android Studio: Exclude resource file under resources sourceSets
body: <p>I'm developing an android app using android studio as IDE.  </p>
  
  <p>My question is:<br>
  How to exclude certain files under certain directory during the process of building APK?  </p>
  
  <p>In my case, I want to exclude some images from building since the those files used in my project are designated to be downloaded from network in-app while during the development I hope to refer them in the layout. </p>
  
  <p>After googling, I found some solutions:<br>
  <a href="https://stackoverflow.com/questions/12617827/gradle-1-2-exclude-directory-under-resources-sourcesets">Gradle 1.2: Exclude directory under resources sourceSets</a><br>
  <a href="https://stackoverflow.com/questions/24721880/how-to-exclude-file-from-resources-using-gradle-and-android-studio">How to exclude file from resources using Gradle and Android Studio?</a><br>
  And <a href="http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.SourceSet.html#org.gradle.api.tasks.SourceSet:resources" rel="noreferrer">reference</a> from gradle.org</p>
  
  <p>Then I came up my solution in build.gradle:</p>
  
  <pre><code>sourceSets {
      main {
          resources.exclude '**/drawable/*'
          res.exclude '**/drawable/*'
      }
  }
  </code></pre>
  
  <p>But it doesn't work, the image under res/drawable/ still shows up(before downloading).  </p>
  
  <p>The Android Studio version is currently 0.8.4.<br>
  Any idea would be appreciated.</p>