Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frequent no inject register for members, but works intermittently. #414

Open
ghost opened this issue Jun 6, 2014 · 0 comments

Comments

0 participants
@ghost
Copy link

commented Jun 6, 2014

Hey :)

I have just finished switching over from RoboGuice and have come across an intermittent issue in my project. My current Dagger version is 1.2.1 and I am using AndroidAnnotations 3.0.1.

I am trying to inject some members into an annotated class (uk.co.connectek.activities.LoginActivity_) but frequently get the message:

"no inject registered for members/uk.co.connectek.activities.LoginActivity_"

My inject module looks like:

@Module(injects =  LoginActivity_.class )
static class ServiceModule{
    public @Provides ILoginService provideILoginService(){
        return new ILoginService_();
    }

    public @Provides IUiMessageHandler provideUiMessageHandler(){
        return new UiMessageHandler();
    }
}

And I call:

ObjectGraph graph = ObjectGraph.create(new ServiceModule());
graph.inject(obj);

Once this error starts occurring I change the line above my module from:

@Module(injects =  LoginActivity_.class ) 

to

@Module(injects =  {LoginActivity_.class} )

and everything works correctly again until I do another build, at which point I revert the @module annotation back to

@Module(injects =  LoginActivity_.class )

When stepping through graph.inject I notice the keys are incorrect. When it fails it is trying to look up the key members/uk.co.connectek.activities.LoginActivity_ but the injectableTypes member on DaggerObjectGraph has the key members/LoginActivity_.

If required I can provide more sample code, or even my project.

Thanks
Dan.

tbroyer pushed a commit to tbroyer/dagger that referenced this issue Sep 3, 2016

Merge pull request square#414 from google/fixed_moe_writing_branch
Sync changes via MOE from google internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.