title: Roboguice throws ClassNotFoundException: AnnotationDatabaseImpl
body: <p>I have a multi module project which has a class derived from RoboActivity with some injected pojo fields.</p>
  
  <p>Those fields' classes also have injected fields which in turn also have injected fields. Some of those classes live in different modules so what I need is cross module injection.</p>
  
  <p>I followed the directions in the Robo Blenders wiki (supposedly) but when trying to run the app I get 'ClassNotFoundException: AnnotationDatabaseImpl' and the app stops.</p>
  
  <p>These are the classes (interfaces not shown):</p>
  
  <pre><code>@ContentView(R.layout.activity_about)
  public class AboutActivityImpl extends AbstractActivityImpl implements AbstractActivity, AboutActivity {
  
      @InjectView(R.id.app_name) private TextView app_name;
      @InjectView(R.id.app_copyright) private TextView app_copyright;
      @InjectView(R.id.app_version) private TextView app_version;
  
      // MVP 
      @Inject
      AboutPresenter presenter;  //IS INJECTED
  
      // MVP 
      @Override
      protected MvpEvent setPresenter() {
          setPresenter(presenter);
          return new AboutActivityInitEvent();
      }
  .
  .
  .
  }
  
  public class AboutPresenterImpl extends AbstractPresenterImpl implements AboutPresenter {
      @Inject
      AppInfo appInfo;  //IS INJECTED
  
      @SuppressWarnings("unused")
      @Inject @Config(Property.APP_COPYRIGHT) //IS INJECTED
      private String appCopyright;
  .
  .
  .
  }
  
  public class AppInfoImpl implements AppInfo {
      @Inject
      AppInfoApi appInfoApi;  //IS NOT INJECTED!!
  
      public AppInfoImpl() {
      }
  .
  .
  .
  }
  
  public class AppInfoApiImpl implements AppInfoApi {
      @Inject
      Application application;  //IS NOT INJECTED!!
  
      public AppInfoApiImpl() {
      }
  .
  .
  .
  }
  </code></pre>
  
  <p>Roboguice modules are as follows:</p>
  
  <pre><code>public class AppModule extends AbstractModule {
      @Override
      protected void configure() {
          bind(AboutPresenter.class).to(AboutPresenterImpl.class);
      }
  }
  
  public class DomainModule extends AbstractModule {
      @Override
      protected void configure() {
          bind(AppInfo.class).to(AppInfoImpl.class);
      }
  }
  
  public class PlatformModule extends AbstractModule {
      @Override
      protected void configure() {
          bind(AppInfoApi.class).to(AppInfoApiImpl.class);
      }
  }
  </code></pre>
  
  <p>Manifest is as follows:</p>
  
  <pre><code>    &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="ar.com.abimobileapps.androidapp"&gt;
          &lt;application
              android:allowBackup="true"
              android:icon="@mipmap/ic_launcher"
              android:label="@string/app_name"
              android:supportsRtl="true"
              android:theme="@style/AppTheme"&gt;
              &lt;meta-data android:name="roboguice.modules"
                  android:value="ar.com.abimobileapps.platform.config.PlatformModule,
  ar.com.abimobileapps.androidapp.configuration.ConfigurationModule,
  ar.com.abimobileapps.androidapp.persistence.config.PersistenceModule,
  ar.com.abimobileapps.androidapp.domain.config.DomainModule,
  ar.com.abimobileapps.androidapp.config.AppModule" /&gt;
              &lt;meta-data android:name="roboguice.annotations.packages"
                  android:value="ar.com.abimobileapps.androidapp,
                                 ar.com.abimobileapps.androidapp.domain,
                                 ar.com.abimobileapps.androidapp.persistence,
                                 ar.com.abimobileapps.platform" /&gt;
              &lt;activity
                  android:name=".ui.AboutActivityImpl"&gt;
                  &lt;intent-filter&gt;
                      &lt;action android:name="android.intent.action.MAIN" /&gt;
                      &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
                  &lt;/intent-filter&gt;
              &lt;/activity&gt;
      .
      .
      .
          &lt;/application&gt;
      &lt;/manifest&gt;
  </code></pre>
  
  <p>These are the modules build.gradle files (snippets):</p>
  
  <p>build.gradle(app module):</p>
  
  <pre><code>dependencies {
  .
  .
  .
      // Roboguice
      compile 'org.roboguice:roboguice:3.0.1'
      provided 'org.roboguice:roboblender:3.0.1'
      // Modules
      compile project(':domain')
      compile project(':platform')
      compile project(':configuration')
  }
  
  project.tasks.withType(JavaCompile) { task -&gt;
      options.compilerArgs &lt;&lt; "-AguiceAnnotationDatabasePackageName=ar.com.abimobileapps.androidapp"
  }
  </code></pre>
  
  <p>build.gradle (domain module):</p>
  
  <pre><code>dependencies {
  .
  .
  .
      // Roboguice
      compile 'org.roboguice:roboguice:3.0.1'
      provided 'org.roboguice:roboblender:3.0.1'
      // Modules
      compile project(':persistence')
      compile project(':platform')
  }
  
  project.tasks.withType(JavaCompile) { task -&gt;
      options.compilerArgs &lt;&lt; "-AguiceAnnotationDatabasePackageName=ar.com.abimobileapps.androidapp.domain"
  }
  </code></pre>
  
  <p>build.gradle (persistence module):</p>
  
  <pre><code>dependencies {
  .
  .
  .
      // Roboguice
      compile 'org.roboguice:roboguice:3.0.1'
      provided 'org.roboguice:roboblender:3.0.1'
  }
  
  project.tasks.withType(JavaCompile) { task -&gt;
      options.compilerArgs &lt;&lt; "-AguiceAnnotationDatabasePackageName=ar.com.abimobileapps.androidapp.persistence"
  }
  </code></pre>
  
  <p>build.gradle (platform module):</p>
  
  <pre><code>dependencies {
  .
  .
  .
      // Roboguice
      compile 'org.roboguice:roboguice:3.0.1'
      provided 'org.roboguice:roboblender:3.0.1'
  }
  
  project.tasks.withType(JavaCompile) { task -&gt;
      options.compilerArgs &lt;&lt; "-AguiceAnnotationDatabasePackageName=ar.com.abimobileapps.platform"
  }
  </code></pre>
  
  <p>AnnotationDatabaseImpl.class files are generated for packages ar.com.abimobileapps.androidapp, ar.com.abimobileapps.androidapp.domain, ar.com.abimobileapps.androidapp.persistence and ar.com.abimobileapps.platform. Inspecting its source code I see that all injected and 'to inject' classes are referenced.</p>
  
  <p>So I cannot understand why I get 'ClassNotFoundException: AnnotationDatabaseImpl' when running the app.</p>
  
  <p>The classes that are correctly injected (AboutActivityImpl, AboutPresenterImpl and AppModule) are in the same project module while the other 2 classes (the failed classes) are in two different project modules (AppInfo/DomainModule in one module, AppInfoApi/PlatformModule in other module).</p>
  
  <p>Roboguice is version 3.0.1.</p>
  
  <p>Any idea?</p>