dagger Questions

8

I'm trying to implement Dagger as a dependency injector in an IntelliJ project, but my code is failing on: import javax.inject.Inject; Intellij is finding the 'javax' package, but not the 'injec...
Glottochronology asked 31/10, 2013 at 23:55

8

Solved

I am trying to add data to firestore. and also i want to do this using dagger. but i keep getting this error. can you help me please...... ** Default FirebaseApp is not initialized in this process ...
Linder asked 13/4, 2022 at 13:58

3

Solved

I am trying to use hilt for my project which contains dynamic features. I am facing an error that I cannot fully understand why. I get an error like this: java.lang.ClassCastException: com.social.a...
Tinnitus asked 29/7, 2020 at 10:31

7

Solved

I just started learning dagger2 and faced a strange issue that looks like a bug to me. Here's the module: @Module public class SimpleModule { @Provides Cooker providerCooker() { return new Coo...
Abbess asked 30/3, 2017 at 11:38

3

I'm trying to upgrade older version project to support SDK 33 and getting this error while compile. error: ComponentProcessingStep was unable to process 'com.irokotv.dagger.AppComponent' because 'c...
Pvc asked 21/9, 2023 at 3:39

1

last time I tried to migrate from kapt to ksp, all libraries with no problem instead of dagger... see libraries dagger2_version '2.47' I got the error logs: e: [ksp] Cannot use legacy dagger.spi.Bi...
Bosporus asked 12/8, 2023 at 14:59

5

Solved

After recently migrating from Dagger to Hilt I started observing very strange behavior with respect to ViewModels. Below is the code snippet: @HiltAndroidApp class AndroidApplication : Application...
Upsydaisy asked 24/6, 2020 at 16:42

17

Solved

In my module, in my base Application class component = DaggerCompClassComponent.builder() .classModule(new ModuleClass()).build(); it can not find DaggerCompClassComponent. I have on module ...
Grandeur asked 3/5, 2017 at 9:43

4

Solved

I use dagger2 demo by https://guides.codepath.com/android/Dependency-Injection-with-Dagger-2. I want to use cached and non_cached retrofit call. I create in NetModule.java @Provides @Named("cached...
Charitacharitable asked 13/7, 2017 at 12:10

3

Solved

I don't understand how to resolve this error. I got this error after trying to add fragments to my application and using Dagger for DI. Here is the error stack: error: [Dagger/IncompatiblyScoped...
Sagittal asked 20/12, 2018 at 21:31

2

I am trying to find a solution in how to define Hilt in a certain fragment related scenario. I have the following setup: Activity Parent Fragment 1 Child Fragment 1 Child Fragment 2 ... Child Fr...
Memoried asked 29/4, 2021 at 11:24

5

After spending a ludicrous amount of time trying to figure out why my dagger injections weren't working; I realised that the "object" type in Kotlin was the problem. The following did not work, th...
Lacteal asked 24/1, 2018 at 2:8

4

Solved

I'm trying to learn dagger 2 but I'm confused in injecting of constructor with interface. This is my below code : MainActivity.java public class MainActivity extends AppCompatActivity implements...
Pump asked 27/12, 2017 at 10:33

6

Solved

So, I'm currently redesigning an Android app of mine to use Dagger. My app is large and complicated, and I recently came across the following scenario: Object A requires a special DebugLogger inst...
Botts asked 16/4, 2013 at 14:45

4

Solved

From dagger-discuss@: I have a class that gets some dependencies from the object graph, and other dependencies from a caller at runtime. public class ImageDownloader { // Get these dependencies ...
Redbug asked 2/4, 2014 at 0:28

4

Solved

I'm new to dagger (though I have experience with DI from working on Java EE WebApps using Weld). What I'm trying to do is to inject a dependency into a class. The field is private. Dagger then t...
Apotheosis asked 16/5, 2013 at 21:54

6

Solved

I'm confronting a weird issue using gradlew(4.10.2) + dagger(2.18). The problem is when I call: ./gradlew :app:compileDebugAndroidTestKotlin The build fails with: Task :Common:compileDebug...
Maramarabel asked 7/11, 2018 at 9:49

5

Solved

I am new to Dagger 2. I have 2 Activities, I want to use injected ViewModel for both. Here is my ViewModuleFactory : @Singleton public class ProductViewModelFactory implements ViewModelProvider.Fa...
Endodermis asked 26/7, 2017 at 12:17

4

Solved

It is really irritating. I need more time to find some class because of dagger 2.
Neighborhood asked 5/7, 2017 at 9:21

2

I am trying to use Room for my new app. But whenever I restart my app, I am unable to retrieve the old data. It looks like my app is creating a new instance of the database every time, but I am not...
Bioplasm asked 27/11, 2017 at 9:28

1

I'm trying to add a singleton Manager into an Android Service. The problem is that the injected manager is not the same as the one in the ViewModel. Dagger Component @Singleton @Component(modules...
Conte asked 30/7, 2017 at 12:20

5

Solved

There are two Fragments: ParentFragment and ChildFragment. ChildFragment has been added to a view of the ParentFragment. Now using Dagger2 for Android has the ParentFragmentModule with a method: ...
Coadjutrix asked 26/5, 2018 at 6:48

8

Solved

Does someone already had to inject an already existing class, with some business logic, into a BroadcastReceiver using dagger? I'm using dagger 1 and already found a nice example (https://github.c...
Deliladelilah asked 30/11, 2015 at 14:59

1

In my project, I have two DataStore ( better API of SharedPref ). I have AuthDataStore and UserDataStore with separate packages. I want to Inject those two DataStores in separate repositories. I us...
Carbon asked 15/2, 2022 at 4:49

5

I am new at the dependency injection on Android. I am using Dagger-Hilt and in AppModule class that I generated for the DB providers I got an error and the project doesn't compile. The error is @In...
Lawyer asked 11/12, 2020 at 22:17

© 2022 - 2024 — McMap. All rights reserved.