title: Compilation errors with Gradle, Android Studio and Butterknife
body: <p>I've imported Eclipse Android project to Android Studio and it fails to compile with following errors:</p>
  
  <pre><code>Error:(7, 8) error: duplicate class: com.company.fragment.PrimaryFragment$$ViewInjector
  </code></pre>
  
  <p>I've tried adding apt plugin:</p>
  
  <pre><code>   apply plugin: 'android'
      apply plugin: 'apt'
  
      android {
          compileSdkVersion 19
          buildToolsVersion "20.0.0"
  
          defaultConfig {
  
              minSdkVersion 15
              targetSdkVersion 19
          }
  
          buildTypes {
              release {
                  runProguard false
                  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
              }
          }
  
          lintOptions {
              disable 'InvalidPackage'
          }
  
          packagingOptions {
              exclude 'META-INF/services/javax.annotation.processing.Processor'
          }
      }
  
  
  dependencies {
      compile project(':library')
      compile 'com.android.support:support-v4:+'
      apt "com.jakewharton:butterknife:5.1.1"
      compile 'com.jakewharton:butterknife:5.1.1'
  
  }
  </code></pre>
  
  <p>I think that this has something to do with <em>Butterknife</em>. But when I make a clean project with it, everything is ok.</p>