dagger-2 Questions

21

Solved

Recent after update Android Studio (2.0.7) (maybe this is the cause) sometimes when building i get that error. Idea is that usually compilation goes well but sometimes I get dagger error. Is poss...
Matthaeus asked 25/1, 2016 at 10:14

1

I'm going to use Anvil in my project. https://github.com/square/anvil But I can't figure out what is desired model of usage for it? Should I have a single global AppScope and merge all bindings fro...
Netherlands asked 3/11, 2020 at 10:59

5

Solved

I'm configuring the new Dagger Android module but I got this error Here's my Component: @AppScope @Component(modules = {AppModule.class, NetModule.class}) public interface AppComponent { @Compon...
Shrove asked 20/5, 2017 at 7:41

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

7

Solved

I have installed Kotlin plugin today into an existing project with Dagger 2. Before Kotlin was installed I had no issues with Dagger. However, now the compiler complains : Error:(5, 32) Unresolved...
Kosiur asked 16/3, 2017 at 20:17

4

Solved

Before upgrading to Android Studio 2.0 I could use Dagger 2 no problem. Now I am getting a NoClassDefFoundError This has shut me down for more than a day and I'm reaching out for some help. It se...

2

If the Application has a Custom Application object. It is needed to annotate this with @HiltAndroidApp ex: @HiltAndroidApp class AppCore: Application Appcore has some initialization logic which is ...
Arpeggio asked 16/7, 2020 at 3:42

3

Solved

I'm reading this great tutorial that explains how @Component.Builderworks in Dagger 2. The author did a good job and the article is straight forward, but there still are some confusing I need to cl...
Helen asked 13/9, 2017 at 12:19

2

Solved

For my Android project, I need global singleton Cache object to access data about a user through the app. A problem occurs when an app goes into the background and after some time of using other ...
Hylophagous asked 1/3, 2018 at 9:43

2

What is the recommended Maven setup for using Dagger 2 in a mixed Java/Kotlin project? I found a sample project which uses Gradle: https://github.com/damianpetla/kotlin-dagger-example Something si...
Macri asked 6/12, 2015 at 16:43

5

Solved

How can I translate something like this: @Module abstract class BaseActivityModule<A : AppCompatActivity> { @Binds abstract fun provideActivity(activity: A): AppCompatActivity companion ...
Protrusion asked 14/6, 2020 at 14:24

4

Solved

I am not certain on the purpose for Dagger2's @Bind annotation. From what i have read online im still not clear but here is an example: @Module public abstract class HomeModule { @Binds publi...
Hurtful asked 1/10, 2018 at 8:7

8

Solved

Context I have started a personal project in java with Gradle as the build system and I want to use Dagger 2 as a DI. The main reason of doing that is to get used to that library and be able to us...
Creigh asked 30/10, 2015 at 20:24

3

Solved

I am currently investigating the use of Dagger2 in my Android application. implementation 'com.google.dagger:dagger:2.21' annotationProcessor 'com.google.dagger:dagger-compiler:2.21' implementati...
Synonym asked 13/3, 2019 at 13:6

3

Solved

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 structure. I have added all the required dependenci...
Congener asked 21/10, 2018 at 7:42

4

Solved

I'm trying to create a simple app with retrofit 2, dagger 2 and MVP, but I struggle with dependencies, actualy, this is the error I get after i try to rebuild the project Error:Execution failed for...
Braunstein asked 6/12, 2016 at 13:18

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

0

I'm developing a multi-module app -too have a clear separation of concerns- with Kotlin in which I'm trying to implement Hilt -to also decouple- and I'm having problems accessing application class ...
Contemporary asked 23/7, 2022 at 9:25

3

I would like to try Hilt DI in the android library. It is a dependency on another project, with its own submodule. The very first problem I've encountered is the requirement of marking Application ...
Kayseri asked 4/8, 2020 at 12:11

16

I'm trying to create my app component, but Dagger does not generate my app component. here is MyApplication class class MyApplication : Application() { companion object { @JvmStatic lateinit va...
Trista asked 8/8, 2016 at 15:32

7

Solved

I have Google this problem, but the results are not work for me. The detail as following. public final class App extends com.zhixin.wedeep.common.BaseApplication implements androidx.lifecycle.Life...
Imbroglio asked 14/7, 2020 at 3:55

6

Trying to build an alexa (amazon:echo) skills set. At the same time, trying to use this experience as a learning testbed for dependency injection through dagger 2. However, building the package usi...
Skysweeper asked 4/4, 2016 at 17:6

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

© 2022 - 2025 — McMap. All rights reserved.