title: Android Studio/Gradle BuildConfig in wrong package
body: <p>I'm quite new to Android Studio and Gradle (used Eclipse to build Android Apps). Now I'm having troubles getting Build Variants working. I have a common part with code, resources, manifest and two Variants (again code, resources and manifest). When building one variant I'm getting compilation errors like "cannot find symbol class <code>BuildConfig</code>" and "cannot find symbol class <code>R</code>" in my variants classes. The variants classes with the errors are referring to <code>BuildConfig</code> and <code>R</code> from the package of the variant: <code>de.danielkasstner.wissensapp.saf.BuildConfig</code> for example. But they get generated in <code>de.danielkastner.wissensapp</code> during build process. </p>
  
  <p>Am I missing something fundemantal? Here is my build.gradle (only important part, I think):</p>
  
  <pre><code>defaultConfig {
      applicationId "de.danielkastner.wissensapp"
      minSdkVersion 11
      targetSdkVersion 21
  }
  
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
      }
  
      hockeyapp {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
      }
  }
  
  productFlavors {
      saf {
          applicationId "de.danielkastner.wissensapp.saf"
          versionCode 14
          versionName "1.0.2"
      }
  
      mola {
          applicationId "de.danielkastner.wissensapp.mola"
          versionCode 25
          versionName "0.6.5"
      }
  }
  </code></pre>