Questions tagged [dagger-hilt]
Hilt is a Dagger2-based dependency injection library for Android.
dagger-hilt
1,464
questions
0
votes
0
answers
10
views
Error on compiling Android system app using Hilt using .bp file
I try to compile an Android system app (Jetpack Compose) in AOSP 13 for Android Automotive. I have success to do that until i try to insert Hilt functionalities.
Researching online, I found that this ...
0
votes
0
answers
30
views
Issue with Hilt Application Class: Gradle Dependency Conflict
I'm working on an Android project that runs fine without the following Hilt application class:
package com.app.bestride
import android.app.Application
import dagger.hilt.android.HiltAndroidApp
@...
0
votes
0
answers
16
views
How to play sound from Glance widget using MediaSessionService
I'm trying to write an app that allows audio to be launched from an app and widget using Jetpack Compose and Glance Widgets. The app shows all audio from the device, which can be controlled (start and ...
0
votes
1
answer
42
views
Dagger Hilt Incompatibility with Dependency Inversion
In an Android project structured to follow the Dependency Inversion Principle (DIP) as outlined in the Android Developer's guide on modularization patterns, I've encountered a challenge with Dagger ...
0
votes
0
answers
31
views
"Dagger Hilt: @Binds methods' parameter type must be assignable to the return type error"
I'm working on a Dagger Hilt setup in my Android project and encountered an error when using @Binds methods.
The error message is:
error: @Binds methods' parameter type must be assignable to the ...
0
votes
1
answer
28
views
Dagger2 injection across modules replace implementation of Interface
I am breaking up my project into different Android Studio modules. At the base, I have a headless modules with core business logic. Down the module dependency tree, I have an app modules that ...
1
vote
2
answers
48
views
Why network call is not triggered while using retrofit with jetpack compose mvvvm
I have an endpoint
https://api.openweathermap.org/data/2.5/weather?q=sukkur,pk&appid=5*****************c
I want to use retrofit to make call to this end point
interface WeatherApiService {
@...
0
votes
1
answer
25
views
Does Using ActivityComponent Scope in Hilt Provide the Same Dependency Instance Across All Fragments in the Activity
As we can see in the attached picture from the Google website,
The SingletonComponent will provide the same dependency instance across the application.
Is this the same for ActivityComponent? Will it ...
-1
votes
0
answers
29
views
App stopped working after upgrading to build.ktx
I have no idea what wents wrong. I tried most approaches on stackoverflow but nothing works. All i figured out that it has something to do with my LdapContactsScreen
java.lang.IllegalStateException: ...
2
votes
2
answers
86
views
Error Build : A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
I am new with Jetpack Compose and Hilt, I got problems when building the application after implementing the class module
Execution failed for task ':app:kaptDebugKotlin'.
A failure occurred while ...
0
votes
1
answer
22
views
Hilt Unsupported metadata version in Kotlin error
I tried to run my code in Kotlin 1.9.0 with the plugins
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
}
and dependencies ...
0
votes
1
answer
70
views
When I use the latest version of ksp and hilt, it gives this error
When I use the latest version of ksp and hilt, it gives this error.
ksp = "2.0.0-1.0.22"
hilt = "2.51.1"
I created a new project and updated all Google libraries and use the ...
-1
votes
0
answers
21
views
Pass Activity Context Instead of Activity [Hilt]
Is it a good pattern design for DI to pass activity instead of context, or should I pass activity context instead and cast it to activity
The main purpose of passing activity is to use the listener in ...
1
vote
0
answers
55
views
Activity Context VS Activity VS Activity Scoped Injection in Hilt
I have some questions regarding Hilt library based on this article I have read :
When (and When Not) to Pass the Activity Context in Android
Why we should inject Context instead of activity object in ...
0
votes
1
answer
134
views
Hilt 2.44.2 - Class not found when use @AndroidEntryPoint at GlanceAppWidgetReceiver
I am implementing widget using Glance API. I am trying to inject dependencies to my widget receiver, however I face an exception in debug mode.
Everything works fine with Activity and ViewModel. What ...