Problem:
I am not seeing any Dagger-generated Components
classes. I have performed clean
, rebuild
, make project
but still don't get them. I am not using the com.neenbedankt.android-apt
plugin as Gradle 2.2.2
doesn't need it.
Using:
Android Studio Version: 2.2.2
Gradle Plugin Version: 2.2.2
Gradle Wrapper: 2.14.1
Dagger:
compile 'com.google.dagger:dagger:2.7'
annotationProcessor 'com.google.dagger:dagger-compiler:2.7'
Application:
public class EventsApplication extends Application
{
private AuthenticationComponent authenticationComponent;
@Override
public void onCreate()
{
super.onCreate();
initDaggerComponents();
}
private void initDaggerComponents()
{
// I'm suppose to use Dagger generated Components here but there aren't any created.
}
public AuthenticationComponent getAuthenticationComponent()
{
return authenticationComponent;
}
}
ApplicationModule:
@Module
@SuppressWarnings("unused")
public class ApplicationModule
{
private final EventsApplication application;
public ApplicationModule(final EventsApplication application)
{
this.application = application;
}
@Provides
@Singleton
@ForApplication
Context provideApplicationContext()
{
return application;
}
}
AuthenticationModule:
@Module
@SuppressWarnings("unused")
public class AuthenticationModule
{
@Provides
MSAAuthAndroidAdapter provideAuthenticationAdapter(final EventsApplication eventsApplication)
{
return new MSAAuthAndroidAdapter(eventsApplication)
{
@Override
public String getClientId()
{
return "";
}
@Override
public String[] getScopes()
{
return new String[]{};
}
};
}
}
AuthenticationComponent:
@SuppressWarnings("unused")
@Component(modules = {AuthenticationModule.class})
public interface AuthenticationComponent
{
void inject(final SignInActivity activity);
}