Dagger Questions
Ad
Is it still necessary to check an object for nullity if it is initialized using Dagger2?
I have an appmodule class where i have the following method that return a firebaseuser object that i want to be
Only one method can create a given subcomponent is created by plus()
I have a dagger subcomponent called usercomponent, created when a user signed in to the app, beneath that i have lists of
Dagger 2 Module Override in Subcomponent
I have app with subcomponents like this -------- applicationcomponent ------------ | |
Retaining Dagger 2 Subcomponent
Is it possible to retain a dagger 2 subcomponent for an activity through a configuration change? it seems like the only two possible solutions
@Component / @SubComponent
What's the difference between @component & @subcomponent in dagger2? when to use which one of those? can you provide examples / code
How to share Dagger2 Subcomponent between activities
I was wondering on how to share subcomponent between activities? let's say i have a global appcomponent that lives with the
Dagger missing binding while adding AndroidInjector
I have the following problem: i started to study dagger 2 and trying to add injections to my app class. here's the code of my app class:
How to inject Network module like this?
I cannot think how to inject network module.i try and find many way to inject network module in dagger 2.but i cannot solve this.please help
Dagger2 create duplicate instance of interface in Module
I use dagger-android in my app with @contributesandroidinjector annotation. @module public
Dagger2 + ViewModel + Repository
I am new to dagger 2 and trying to implement it in kotlin. here i am trying to inject my repository object into viewmodel. i am successfully able
Ad
Is it okay to perform Dagger 2 injection inside a constructor of an Activity
The examples online regarding dagger2 for android always perform dependency injection inside the oncreate
Dagger2 dependency injection: How does it work in an android app?
I am trying to understand an
Shall we pass injected object in another class
I am just playing around the dagger2 for di implementation in android. my query is nothing about the problem that i am facing but just a
Dagger 2 acessing named dependencies in dependant module
I'm converting a legacy codebase to a multi feature module architecture, and i'm currently trying to sort out my dagger setup, but having some
WorkManager Java Android Dagger2
I need working workmanager in android app with java only (without kotlin!!!). in a project, we use just dagger2.8 (without android-dagger!) and i
Field not being injected with Dagger
In the following code, the field serviceutil is not being injected by dagger: appcontroller.kt class app : application() {
Dagger subcomponent with contributor
I'm having trouble injecting a fragment that i contribute via @contributesandroidinjector. i'm trying to build a hierarchy
Android Dagger not building
I have already added dagger into my application. now i am facing the following error after updating android studio and project updated to the
How to @Inject into Kotlin Builder classes with Dagger
My current android project employs a number of kotlin data classes that employ builders to construct them. i wish to inject an instance
How to make MVRX viewmodels work with dagger2?
Edit adding the @viewmodelkey and making sure all the viewmodels have the @inject annotation did the trick
Dagger 2.10+: Inject dependency with activity context in Activities and Fragments
I have a class called alertmanager which requires activity instance to show toast and
Ad
Injecting Androidx Activity with Dagger 2
I am newbie in dependency injection with dagger in android i have this error unable to start activity componentinfo{mainactivity}:
Android auto inject dagger modules on each of i need that
After successful implementing dagger on project i have to specify dagger to each of class i want to use and inject modules, for example
How to inject Repository into ViewModel?
I am using dagger 2 and i have a dicomponent defined as follows: @singleton @component(modules = {
Update to Kotlin 1.3.30 breaks build with Dagger 2.21
Build error after update from kotling 1.3.21 to 1.3.30: appcomponent.java:16: error: [dagger/missingbinding]
Retrofit service is always null after adding Interceptor and injecting it using Dagger2
I have a relogin retrofit service like this interface tokenservice { @get("re-login") fun relogin():
Why do Dagger components have to declare their scope?
Why do i have to annotate a dagger component with the scopes it's going to use? why is it not enough to annotate the class itself?
Inject provider of ViewModelProvider.Factory into esspresso test
I have custom implementation of viewmodel.factory which is provided by lambda injected by dagger2
Dagger 2 Dispatching Android Injector
I am trying to use the new dagger api for activity injection but i am getting error lateinit property dispatchingandroidinjector has not
Android Jetpack Pagination using Fragment: Adapter not receiving callback
I am following the approach described in
Project structure with Dagger2
I'm learning how to use dagger2 and mvp, so i created project, contains one main activity with
Ad
error: Dagger/MissingBinding CryptoCurrencyViewModelFactory cannot be provided without an @Inject constructor or an @Provides-annotated method
I don't understand why am i getting this error:
Dagger Injection for dependent components
I am using dagger2 and i want to know if it is possible to use the new android injector for dependent components? i have
How to use Dagger2 library
In my application i want use dagger2 and for this i write below codes. my component class name is
How to access SharedPreferences in a ViewModel?
I am developing an android application using mvvm. i need to access sharedpreferences in a viewmodel, but i do not know
Dagger2: ViewModel cannot be provided without an @Provides-annotated method
I am following the architecture used by
Error: cannot find symbol class DaggerAppComponent
I downloaded several sample projects from github that use dagger, e. g.
Dagger 2 get old token when token is refreshed
I am having a problem with dagger 2. briefly, dagger 2 makes the injection in my fragment, and if the token is expired. tokenauthenticator asks
Not able to inject ViewModel with dagger2 android java
I am trying to inject viewmodel with help of a common viewmodelproviderfactory in dagger2.
Objects after inject is null
I am trying to inject objects that are singletons to 2 activity. my problem is, milk and coffee object after @inject are null into activity.
dagger 2.20 support for androidx package structure
Is dagger 2.20 working with the androidx package structure? i'm using kotlin. i get the error below during build. [kapt] an
Dagger Hilt: Repository cannot be provided without an @Provides-annotated method
Hilt points out that this interface cannot be provided without an @provides annotation: interface plannedlistrepository { fun
Ad
Why AdnroidInjector.inject(fragment) uses deprecated android.support.v4.app.Fragment
I'm using dagger2 for di in android app, i want inject viewmodel in a fragment by androidinjector and have this two line
Where to inject AndroidInjection in custom/util classes using dagger2 in java android
I am using dagger 2. and injecting my dependency in activities and fragments which is working fine.
How does AssistedInject for Dagger 2 work?
The assitedinject library from square is actually an annotation
CustomScope may not reference bindings with different scopes
I am new to dagger, i have defined my application component like this @singleton @component(modules = {applicationmodule.class})
Dagger 2 subcomponent across Android modules
Recently i started to divide our application into smaller android modules, but i can't figure out how to structure dagger so it works for me.
AlertDialog with dagger - You must call removeView() on the child's parent first - Android
I am using from alertdialog with dagger like bellow: @module(includes = {
What can I do if Dagger's annotation doesn't work?
Unfortunately, even though, that i added dependencies of dagger. dagger's annotation is not visible. i've tried invalidate caches and restart.
Unable to inject dependency in fragment using dagger2 in Java Android
I am able to inject dependency in activities and its working fine. but calling the same dependency in fragment is not taking access. this
Dagger with FragmentPagerAdapter - android
I am using from dagger in my viewpager like bellow. my viewpageradapter.java: public class
How to inject a ViewModel into BottomSheetDialogFragment with Dagger2?
I inject my dependencies in activities and fragments on the preferred way with androidinjection.inject(this). i have the recommended
Dagger 2 error: dependency “cannot be provided without an @Provides-annotated method"
I've started using dagger 2 with android injector and faced an issue i have 5 modules, that are composed into one component
Ad
How to inject Dagger dependendcies anywhere, except Activity?
I'm new to dagger, so couple of things are still hard to grasp for me. i have a component: @singleton @component(
Failed resolution of: Lcom/google/common/collect/ImmutableMap; at com.my.app.di.DaggerMyApplicationComponent.getMapOfClassOfAndProviderOfFactoryOf(
I am getting this issue after integrating dagger 2 to implement dependency injection of imagedownloader library while running the app.
How to perform a Dagger 2 Constructor, Method, Field Injection?
I'm practicing dagger 2 for a week now, i just want to know the difference of these injections(constructor,
Dagger 2 How to solve constructor dependency
I am an android developer and trying to learn dagger2. i have gone through some tutorials and got some basic understanding. i
Dagger2: how to inject retrofit module in presenter class
Dagger2 learning is still difficult and am trying to learn. have setup a project using new dagger android to avoid injecting inside activity
How to read hostname from meta-data when providing Retrofit in DI Modules?
I am using dagger 2 + retrofit to implement my interfaces which sends/receives data to/from my web service i am referring
Dagger2 Injection Unit Tests is null
Hi i have used dagger for dependency injections of network module, applicationmodule, databasemodule, presenters and interactor in my app. i want
Proguard rule setup for mvvm
The code is working fine without proguard rule setup. but when i enabled proguard in release build, the project is build successfully. app is
Cannot find symbol class DataBindingComponent caused by java.util.NoSuchElementException
I have a project where i'm using dagger version 2.18 (implementation "com.google.dagger:dagger:2.18") in android studio
Make a class injectable and a singleton with Dagger annotation only
I know there are tutorials of how to define singleton with module. but my question is not really on that. i mean dagger also provides
Picasso not loading images with Dagger 2
I'm still learning dagger 2 and tried to create a simple app using it. i am having trouble making picasso work since i can't see any errors in the
Ad
Android build fails when using dagger 2.18 with kotlin kapt
I am attempting to include in my android project the dagger android processor version 2.18 with kotlin-kapt. i am also using the androidx package
Failed to resolve variable '${project.groupId}'
I migrate my project to androidx and i got these errors when building the project: [tag] failed to resolve variable
Kotlin Android MVP + Dagger 2 lateinit property presenter has not been initialized
Trying to use dagger with kotlin on android. and got the exception: caused by: kotlin.uninitializedpropertyaccessexception:
What is the use case for @Binds vs @Provides annotation in Dagger2
I am not certain on the purpose for dagger2's @bind
Android. Could not instantiate Worker
I want to pre-populate my room database from the json file in the assets folder. i follow the
Dagger 2 - Constructor Injection - Non-Activity
Just started learning dagger 2 in order to solve a specific problem: im trying to follow an mvvm architecture and my application has a repository
Dagger - lateinit property presenter has not been initialized android
I am using kotlin and java together in my project. i created a bridge class for use
I am facing Dagger implementation issue
i implemented complete dagger implementation like added component,provides,module and inject and at the end i face following
one object if injected into 2 subcomponents under same custom scope, every time new instance is created of that object
One object if injected into 2 subcomponents under same custom scope, every time new instance is created of that object. i want same instance to be
Dagger2 vs Application class in android
By this simple example public class myapp extends application { private static myapp app; private imagedownloadercomponent
How to add DI (Dagger 2) in Activity and its parent
I use dagger 2 in my android project and want to use the @inject in an activity and inside another activity which extends the first
Ad
Android: Dagger 2 interferes with Immutables?
Getting a really strange issue; hopefully you guys can help. i have been using
How does Dagger 2 dispose of injected fields when they are no longer needed?
I have a question about injecting multiple fragments into the activity's fields. currently i have such a set up (all fragments extend
error: [Dagger/MissingBinding] [dagger.android.AndroidInjector.inject(T)] Dagger
I wanna to make a simple project with one main activity and multiple fragments. here i have two fragments at one activity and i want to inject
Dagger2 Multibinding [dagger.android.AndroidInjector.inject(T)] Found a dependency cycle:
I am trying to replicate what viewmodelfactory does for my presenter classes, here is my dagger2 code public class app extends
error: cannot find symbol method inject(TestApplication)
I'm completely new in dagger 2. to commence working with it, i have written some codes. after building code i have encountered following
After the subscription is added to disposable in RxAndroid (Observable), the control flow ends without calling subscribe..!
I am trying to use mvp, rx and dagger 2 in android. the following is the code flow, localdatasource.java
Cannot Find Symbol @Generated Using Dagger 2 and Proguard in Library Module
I had to have my laptop imaged at work. now the project won't build. other developers can continue building at the same commit fine so it must be
Android Kotlin with Dagger2, lateinit var has not been initialized
I'm a dagger newb and have a trouble with using it. what i want to develop is that using rxandroidble and to initialize it by dagger for
ViewModel is recreated after rotation; if injected directly with dagger2
Possible duplicate of this i am exploring
Should I dispose disposables in a Singleton class ( Android RxJava 2 )
When i subscribe({}) to an observable in a singleton class, do i need to call .dispose() method at some point? and if
Dagger2 conversion to android.dagger
I studied some tutorials about new dagger.android approach but can't make it right. i built a simple tutorial with subcomponent builder but i
Ad
Stuck attempting to implement the official Dagger strategy to avoid cumbersome code
In my efforts to follow the good and official advice for injecting and avoiding cumbersome code (which i had) from
How to implement Dagger for worker classes in Dagger 2.16 ?('android.arch.work:work-runtime')
How to implement dagger for worker classes in dagger 2.16? public class syncworker extends worker { @inject
How can I create ViewModel and inject repository to it with dagger 2?
I try understanding viewmodel. i create viewmodel: public class usersviewmodel extends viewmodel { private final
Dagger2 issue with "cannot be provided without an @Provides-annotated method."
I'm trying to setup a new project with dagger2, i've used dagger2 before, but now i'm trying to set it up from scratch by myself. i'm getting the
Dagger code works, how to make that Toothpick code work the same way?
I am starting using toothpick and i need to migrage from dagger code to toothpick. well, i have next string at my project with dagger.
Dagger 2 - dependency is not singleton when using custom scope
I have custom scope: @scope @retention(retentionpolicy.runtime) public @interface peractivity { } and component
dagger2, how can i call @BindsInstance denoted method of SubComponent..?
Please help me! i have a trouble in use of dagger 2. i want to bind some dependency in runtime not in compile time inside
Dagger 2, Providing Application Context in Module
Im pretty new in android development and newer in di. i am using kotlin on a personal project where i am experimenting with dagger 2. i managed to
Dagger2 Component inject for multiple Activities
This seems very basic question for dagger2 users . i have recently started exploring it with retrofit. i have followed
UninitializedPropertyAccessException: lateinit property pref has not been initialized
I know a similar question has been answered
How to add Authorization header in retrofit call using Dagger 2
I have a working code example of token based api authentication(laravel passport), but it's without dagger 2. i want to move code from current
Ad
Default implementation using dagger if @Named not found
The problem i am facing is that i have a base class and multiple child class. for resolving the particular child class i am using @named
How to implement Dagger for worker classes?
Since the worker class is created by the framework (workermanager), how can we use @inject fields into
Ad
Blog Categories
Ad