title: "Cannot find symbol variable BuildConfig" with multiple source folders
body: <p>I'm working with a project that have a lot of legacy code. I need to keep separated the "old code" from the new one. So I created the following directories:</p>
  
  <pre><code>-ProjectRoot
    -app
      -src
        -main
          -java
          -java_legacy
          -res
          -res_legacy
  </code></pre>
  
  <p>And added the following block to my <code>build.gradle</code>:</p>
  
  <pre><code>android {
          .....
          sourceSets {
              main.java.srcDirs += 'src/main/java_legacy'
              main.res.srcDirs += 'src/main/res_legacy'
          }
  }
  </code></pre>
  
  <p>But when I try to run the app I get the error:</p>
  
  <pre><code>error: cannot find symbol variable BuildConfig 
  </code></pre>
  
  <p>The file where the error is shown seems random and does NOT use nor import the class BuildConfig.</p>
  
  <p>If I empty the code inside the file generating the error, it appears in another (pseudo-random) file.</p>
  
  <p>How can I solve this?</p>
  
  <p>Note: I tried, <code>"Build/CleanProject"</code>, <code>"File/ Invalidate Caches / Restart ..."</code>, 'Synchronize gradle build"  but the error persists</p>