Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

android.app.Application does not implement dagger.android.HasActivityInjector #552

Closed
kingning1 opened this issue Sep 6, 2017 · 3 comments

Comments

@kingning1
Copy link

public class Myapp extends DaggerApplication implements HasActivityInjector {

@Inject
DispatchingAndroidInjector<Activity> activityDispatchingAndroidInjector;

@Override
public void onCreate() {
    super.onCreate();
}

@Override
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
    return DaggerAppComponent.builder().create(this);
}


@Override
public DispatchingAndroidInjector<Activity> activityInjector() {
    return activityDispatchingAndroidInjector;
}

}

这是我的Application 但是每次运行都会报这个错误很是不解,求救!

@JakeWharton
Copy link
Collaborator

You need to specify your application subclass in the manifest on the <application> tag.

@kingning1
Copy link
Author

不好意思,疏忽大意了!
谢谢您在百忙之中的帮助。

@JakeWharton
Copy link
Collaborator

Just noticed that I think you want https://github.com/google/dagger/ and not this repo. Dagger 1 doesn't have HasActivityInjector.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants