title: why does dagger 2 generated components gets deleted on project rebuild?
body: <p>The problem exists when the code that uses the generated 'Dagger' prefixed on a component is not commented out. If it was commented out, the generated Dagger 2 files are generated.</p>
  
  <p>BookModule</p>
  
  <pre><code>@Module
  public class BookModule {
  
      @Provides
      public Book providesBook(){
          return new Book();
      }
  
  }
  </code></pre>
  
  <p>BookComponent</p>
  
  <pre><code>@Component(modules = BookModule.class)
  public interface BookComponent {
  
      void inject(MainActivity activity);
  
      public Book getBook();
  
  }
  </code></pre>
  
  <p>MainApplication</p>
  
  <pre><code>public class MainApplication extends Application {
  
      public static BookComponent mBookComponent;
  
      @Override
      public void onCreate() {
          super.onCreate();
          mBookComponent = DaggerBookComponent.builder().bookModule(new BookModule()).build();
      }
  }
  </code></pre>
  
  <p>Build.gradle(Application)</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:2.1.3'
          classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>Build.gradle(Project)</p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'com.neenbedankt.android-apt'
  
  android {
      compileSdkVersion 24
      buildToolsVersion "25.0.2"
  
      defaultConfig {
          applicationId "com.example.bryan.myapplication"
          minSdkVersion 15
          targetSdkVersion 24
          versionCode 1
          versionName "1.0"
          jackOptions{
              enabled = true
          }
      }
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:24.2.0'
      compile 'com.android.support:support-v4:24.2.0'
      compile group: 'com.google.dagger', name: 'dagger', version: '2.10-rc1'
      apt group: 'com.google.dagger', name: 'dagger-compiler', version: '2.10-rc1'
      compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3'
  
  }
  </code></pre>
  
  <p>Error Stacktrace</p>
  
  <pre><code>ERROR: C:\bin\AndroidProjects\MyApplication\app\src\main\java\com\example\lloyd\myapplication\MainApplication.java:12.26: DaggerBookComponent cannot be resolved
  
  com.android.jack.api.v01.CompilationException: Failed to compile
      at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:144)
      at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJackApis(AndroidBuilder.java:1931)
      at com.android.build.gradle.tasks.JackTask.doMinification(JackTask.java:148)
      at com.android.build.gradle.tasks.JackTask.access$000(JackTask.java:73)
      at com.android.build.gradle.tasks.JackTask$1.run(JackTask.java:112)
      at com.android.builder.tasks.Job.runTask(Job.java:51)
      at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41)
      at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:223)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: com.android.jack.frontend.FrontendCompilationException: Failed to compile
      at com.android.jack.Jack.buildSession(Jack.java:1053)
      at com.android.jack.Jack.run(Jack.java:540)
      at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:124)
      ... 8 more
  </code></pre>
  
  <hr>
  
  <pre><code>mBookComponent = DaggerBookComponent.builder().bookModule(new BookModule()).build();
  </code></pre>
  
  <p>The code from above is in the MainApplication and it is the problem, if I commented it out, it rebuilds completely fine. But when I left it as it is, it got an error saying the 'DaggerBookComponent' cannot be resolved, by this time the generated DaggerBookComponent is deleted which results in cannot be resolved</p>