dagger-hilt Questions
9
Solved
I changed my Kotlin version from 1.6.10 to 1.7.0.
from this
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10'
upgrated to
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1....
Chenay asked 26/6, 2022 at 22:5
4
Solved
I have been recently trying to migrate my Android App from Dagger to Hilt.
I would like to carry out the entire migration in phases and hence was trying to suppress the Hilt warning for not using @...
Isma asked 3/8, 2020 at 9:15
13
Solved
I'm getting the error "The Hilt Android Gradle plugin is applied but no com.google.dagger:hilt-android-compiler dependency was found." while building the project.
Here's how I'm adding hi...
Azaleah asked 13/7, 2020 at 19:14
4
Solved
I have an Android project with Hilt dependency injection. I have defined MyApplication and MyModule as follows.
@HiltAndroidApp
class MyApplication : Application()
@Module
@InstallIn(ApplicationCo...
Gonadotropin asked 6/9, 2020 at 16:47
2
Solved
I use compose version 1.1.0-beta03 and hilt-navigation-compose:1.0.0-beta01.
this is my Composable code:
fun EngagementBotChart(modifier: Modifier = Modifier) {
val newHomeViewModel = hiltViewMode...
Gt asked 21/11, 2021 at 9:35
6
Solved
In Dagger Hilt View Model 1.0.0-alpha01
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha01"
implementation 'com.google.dagger:hilt-android:2.28-alpha'
kapt 'androidx....
Middlebuster asked 13/2, 2021 at 13:49
2
Solved
I have an Android app where the codebase is split into 2 different modules: App and Domain
Goal: I am attempting to use the Hilt provided testing functionality to replace a Domain internal dependen...
Metatherian asked 29/12, 2021 at 15:50
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
4
Solved
I get this warning when I try to run or build an app in Android Studio. Why am I getting this? Do I need to heed this warning?
The following options were not recognized by any processor: '[dagger.f...
Chism asked 1/1, 2022 at 18:17
7
Solved
I'm using Hilt to inject context and other dependencies into my HomeViewModel class; Everything is working properly but I'm getting this warning.
How can I prevent from leakings?
This is my HomeFra...
Hallam asked 15/2, 2021 at 23:33
3
So I want to test my jetpack compose project. It's easy enough running an instrument test following [these instructions]1 on android dev site, but when you add @HiltViewModel injection into the com...
Whitehouse asked 18/8, 2021 at 5:12
4
I'm using a third-party library that has some custom view implementations. In the implementation, they call Utils.showSoftKeyboard(context as Activity). This, along with using the fragment as an @A...
Tarsus asked 13/10, 2020 at 18:51
3
Solved
I'm looking at the developer doc for the latest version to use Dagger Hilt, but I can't find a version similar to what I've seen on the web.
In other web sample code that uses hilt, I added hilt ve...
Concession asked 25/4, 2022 at 17:37
1
Solved
I’m working on an Android project with Kotlin and using Dagger Hilt for dependency injection. Recently, I’ve attempted to migrate from kapt to KSP (Kotlin Symbol Processing) for code generation, as...
Absentee asked 5/11, 2023 at 2:56
2
Is it mandatory to add @AndroidEntryPoint annotation on all dependent classes like fragment dependent upon activity. Is there any alternative solution for overcome this exception?
Aurthur asked 9/7, 2020 at 9:22
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
2
Solved
I would like to share a viewmodel between many composables. Just like how we share a viewmodel between fragments within an Activity.
But when I try this
setContent {
val navController = rememberNa...
Saadi asked 20/10, 2021 at 8:8
16
Solved
Trying to integrate hilt using android Api Documentation but app crashed with following exception. https://developer.android.com/training/dependency-injection/hilt-android
java.lang.RuntimeExceptio...
Buckden asked 10/8, 2020 at 7:18
1
Solved
Sending Result Back with SavedStateHandle does not work with SavedStateHandle injected in ViewModel.
Getting result using navController.currentBackStackEntry?.savedStateHandle? it works!
fun Create...
Naquin asked 13/8, 2023 at 6:57
5
Based on the Hilt tutorial, ViewModels needs to be inject the following way:
@HiltViewModel
class ExampleViewModel @Inject constructor(
private val savedStateHandle: SavedStateHandle,
private val...
Billet asked 28/6, 2021 at 16:50
5
Solved
I got following error when i run my unit test code.
Caused by: java.lang.IllegalStateException: Hilt Fragments must be attached to an @AndroidEntryPoint Activity. Found: class androidx.fragment.app...
Mayst asked 31/7, 2020 at 10:12
2
I don't know why I am receiving " @InstallIn-annotated classes must also be annotated with @Module or @EntryPoint: com.example.newsapp.di.AppModule
[Hilt] Processing did not complete. See erro...
Runnels asked 8/9, 2022 at 5:20
2
Solved
In my instrumentation tests I have noticed that my Retrofit components are created before the test even does the hiltRule.inject() command.
This is probably because I'm using WorkManager and early ...
Literati asked 1/3, 2023 at 14:50
1
I am new to Hilt/Dagger and I have not found a good example of injecting in a companion object. Here is my singleton and data class below. I am trying to use the TargetNumber manager in the create(...
Dialyser asked 8/2, 2021 at 13:51
8
Solved
In exploring the ViewModelInject of Dagger-Hilt, I follow the example in https://developer.android.com/training/dependency-injection/hilt-jetpack#viewmodels
I try to inject the ViewModel into my ac...
Sinuous asked 30/6, 2020 at 13:55
© 2022 - 2024 — McMap. All rights reserved.