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

Unable to inject a constructorer injected dep in LifecycleObserver with @ActivityContext binding #233

Open
evilthreads669966 opened this issue May 31, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@evilthreads669966
Copy link
Owner

It's complaining about ReschedulingReceiver matching the same key.

C:\Users\evilt\AndroidStudioProjects\EvilScreenNew\app\build\generated\source\kapt\debug\com\evilthreads\App_HiltComponents.java:141: error: [Dagger/MissingBinding] @dagger.hilt.android.qualifiers.ActivityContext android.content.Context cannot be provided without an @Provides-annotated method.
  public abstract static class SingletonC implements ReschedulingReceiver_GeneratedInjector,
                         ^
  A binding with matching key exists in component: com.evilthreads.App_HiltComponents.ActivityC
      @dagger.hilt.android.qualifiers.ActivityContext android.content.Context is injected at
          com.evilthreads.LockObserver(activityContext, �)
      com.evilthreads.LockObserver is injected at
          com.evilthreads.lock.ui.LockActivity.lockObserver
      com.evilthreads.lock.ui.LockActivity is injected at
          com.evilthreads.lock.ui.LockActivity_GeneratedInjector.injectLockActivity(com.evilthreads.lock.ui.LockActivity) [com.evilthreads.App_HiltComponents.SingletonC ? com.evilthreads.App_HiltComponents.ActivityRetainedC ? com.evilthreads.App_HiltComponents.ActivityC]
@evilthreads669966 evilthreads669966 added the bug Something isn't working label May 31, 2021
@evilthreads669966
Copy link
Owner Author

A performance costing workaround is @ApplicationContext

@evilthreads669966
Copy link
Owner Author

Nevermind. I think I tried to inject activity context into a singleton that isn't activity scoped

@evilthreads669966
Copy link
Owner Author

So since the updated HIlt. I need to take ReschedulerReceiver out of SingletonComponent but I haven't seen the code yet as it looks kike the newest version doesn't use ApplicationComponent any longer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant