I have these warnings and I don\'t understand what they mean. Can someone point me to something?
For classes I inject into (where there is a component.inject(this)
I was getting this "Generating a MembersInjector for..."
Dagger 2 warning when I had a superclass and subclass as follows...
public abstract class BaseActivity extends Actvity {
@Inject
DependencyA dependencyA;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
((MyApplication) getApplication()).getComponent().inject(this);
}
public class ConcreteActivity extends BaseActvity {
@Inject
DependencyB dependencyB;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
((MyApplication) getApplication()).getComponent().inject(this);
}
}
... and my Component
interface had two inject methods as follows...
void inject(BaseActivity activity);
void inject(ConcreteActivity activity);
I removed the inject(BaseActivity activity)
method from my Component
interface and I removed the Component.inject(this)
method call from the BaseActivity
class. The injection in BaseActivity
still works as expected when the subclass (ConcreteActivity
) calls Component.inject(this)
and I do not see the "Generating a MembersInjector for..."
Dagger 2 warning anymore when I build the application.