title: Android build - "duplicate class: com.myapp.R"
body: <p>I'm stumped by this build error. It appears it may be related to using AppCompat, as if I remove that dependency from the build file the build error is no longer present. I am not using product flavors, and actually this project is very simple indeed - one Android module, a few classes and some resources. I'm using the Android Studio beta, 0.89 (latest).</p>
  <p>I searched the source tree and can see two files called R.java, one in the app namespace the other in the AppCompat namespace.</p>
  <p>Related is a second build error:
  &quot;duplicate class: com.myapp.BuildConfig.java</p>
  <p>Searching reveals only one file with that name in the project.</p>
  <p>What does this build error mean, and how do I fix it?</p>
  <h2>build.gradle</h2>
  <pre><code>apply plugin: 'com.android.application'
  
  android {
  compileSdkVersion 19
  buildToolsVersion &quot;20.0.0&quot;
  
  defaultConfig {
      applicationId &quot;com.myapp&quot;
      minSdkVersion 15
      targetSdkVersion 19
      versionCode 1
      versionName &quot;1.0&quot;
  }
  buildTypes {
      release {
          runProguard false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }
  }
  
  dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:19.0.0'
  
  }
  </code></pre>