Bri6ko Bri6ko - 1 year ago 172
Android Question

Dagger2 Not Generating Dagger* classes

As the title says, Dagger2 is not generating the Dagger* prefixed classes. I looked at some other similar posts here but nothing seems to work.

I cloned this repo, Invalidated the cache of Android Studio and restarted it, I deleted

, Clean and Rebuild the project and still not working.

This has also happened on some projects that are using Dagger2

Am I missing something?

apply plugin: ''
apply plugin: ''

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"

defaultConfig {
applicationId "com.example.ecgreb.mvpc"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), ''

tasks.withType(Test) {
testLogging {
exceptionFormat "full"
events "started", "skipped", "passed", "failed"
showStandardStreams true

repositories {

dependencies {
compile ''
compile ''

compile ""
annotationProcessor ""
provided 'javax.annotation:jsr250-api:1.0'

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.robolectric:robolectric:3.1.2'
testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1'

The Application class.

package com.example.ecgreb.mvpc;


import com.example.ecgreb.mvpc.controller.LoginActivity;

import javax.inject.Singleton;

import dagger.Component;
public class MvpcApplication extends Application {

@Singleton @Component(modules = { LoginModule.class }) public interface ApplicationComponent {
void inject(LoginActivity loginActivity);

private ApplicationComponent component;

@Override public void onCreate() {
//DaggerApplicationComponent IS NOT BEING GENERATED
component = DaggerApplicationComponent.builder().build();

public ApplicationComponent component() {
return component;

Answer Source

Instead of

 annotationProcessor ""


 apt ""
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download