1,509 questions
1
vote
0
answers
33
views
Hilt - java.lang.String com.squareup.javapoet.ClassName.canonicalName() [closed]
I'm learning Android development and decided to add Dagger Hilt to my project. I've been struggling for a week with the `:app:hiltAggregateDepsDebug` task error.
It throws: `Unable to find method '...
0
votes
0
answers
35
views
Dagger Hilt: "ComponentProcessingStep was unable to process … because '<package>.health.HealthRepo' could not be resolved" in release build
Description
I'm facing a Hilt compilation error only when creating a release build (with minifyEnabled true).
The debug build compiles and runs fine.
Error message:
error: ComponentProcessingStep was ...
2
votes
1
answer
119
views
Error when running a HiltWorker on app start: NoSuchMethodException
I’m trying to make a Worker run automatically when the app starts for testing purposes. The idea is that when I open the app, the Worker fetches the list of tracked animes and shows a notification for ...
3
votes
1
answer
74
views
How to fix java.lang.NoSuchMethodException when using a Hilt Worker?
Hilt keeps not initializing the Worker just because of sharedPreferences variable here
@HiltWorker
class AnilistNotificationWorker @AssistedInject constructor(
@Assisted private val context: ...
0
votes
0
answers
65
views
How to initialize Android OkHttp cache interceptor config at app start without blocking the main thread (Hilt + Coroutines)?
I have a CacheCreation class that prepares config for an OkHttp interceptor. It’s created during DI on app launch, and we currently use runBlocking so the object graph is ready before the first ...
2
votes
1
answer
148
views
Unresolved references with HiltViewModels. Android Jetpack Compose
With the following implementations, I'm getting unresolved reference errors with hiltViewModel(). Below is a view where I'm trying to implement a hiltViewModel(), the model, and all relevant build ...
0
votes
1
answer
44
views
What to do when a dependency needed before hilt injection
Architecture Setup
I have a multi-module architecture with:
Dependency Injection Setup (DataStoreModule):
@Module
@InstallIn(SingletonComponent::class)
object DataStoreModule {
private const val ...
0
votes
1
answer
104
views
Crashing the app while navigate to the Composable which accept the HiltviewModel
I am currently working on a project that includes an onboarding screen and a profile screen. The onboarding screen is implemented using a ViewModel integrated with Hilt (@HiltViewModel). The ...
-1
votes
1
answer
73
views
How to have multiple instances of the same database class (with different database names) using Hilt and RoomDB?
I want to create multiple, separate databases of the same structure (all using the same RoomDatabase class and DAOs). I'm using Room DB and Hilt, and am using a provider like below to create the ...
0
votes
0
answers
77
views
Jetpack Compose / Hilt MVI: ViewModel state not reset when closing and reopening dialog
I’m building a Jetpack Compose screen using an MVI pattern (ViewState / ViewEvent / ViewEffect) and Hilt for DI. I have a modal dialog with an input field for a name. The dialog’s composable looks ...
-1
votes
1
answer
86
views
"java.lang.RuntimeException: Cannot find implementation for Room database - AccountDataDataBase_Impl does not exist"
I'm encountering a java.lang.RuntimeException in my Android application, specifically:
java.lang.RuntimeException: Cannot find implementation for com.daviddev.passwordmanager.Room.AccountDataDataBase. ...
2
votes
0
answers
135
views
Issues Importing an .AAR SDK in a Nitro Modules Native Module for Expo
I'm developing a Nitro Modules native module to integrate an Android SDK into an Expo React Native app. I've successfully created mock functions with the correct typings, but I'm facing issues ...
0
votes
1
answer
69
views
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/test/platform/io/FileTestStorage
I have an Android multi-module project, in which one I a trying to run instrumented tests.
My "feature" modules are android libraries and the instrumented tests run correctly.
But I have an ...
0
votes
0
answers
46
views
Dagger/MissingBinding Error Injecting Map with Custom Keys in Hilt ViewModel
I'm trying to inject a Map of strategies into my ViewModel using Hilt. Each strategy is associated with a different table class, and I'm using a custom annotation (TableStrategyKey) as the map key.
@...
0
votes
0
answers
53
views
How can I observe for date or timezone changes to update the UI using MVVM, UseCase and Hilt?
I have a interface called TimeZoneMonitor to monitorize Time Zone or Date changes.
I also have a UseCase that queries the database, looking for information based on the current system date.
The code ...
0
votes
0
answers
44
views
Hilt NullPointerException on Windows 10: Could not get element for MyApp_GeneratedInjector
I'm using Hilt for dependency injection in my Android project. The project builds and runs perfectly on macOS, but I encounter a NullPointerException when building on Windows 10. The error occurs ...
1
vote
1
answer
53
views
How to add Proto Datastore content to UIState for use in a Composable?
I'm using Hilt, and the MVVM pattern to get content that is in local files in my app.
Now I want to add to FileUiState content that references UserData (these are user preferences saved using ...
2
votes
0
answers
81
views
Creating a compose navigation scoped Repository?
I'm building an Android app with Kotlin, Jetpack Compose, and Hilt for dependency injection. My app has a KYC flow that spans about 10 screens(has own navigation graph of this flow), each with its own ...
-1
votes
1
answer
58
views
context.resources.getIdentifier throw resourcenotfoundexception
i am using
val name = if (!formula.productName?.nameRes.isNullOrBlank()) {
stringResource(getStringResId(formula.productName?.nameRes!!))
} else if (!formula.productName?.name.isNullOrBlank()...
0
votes
0
answers
136
views
Datadog (Android SDK) Logs not going through to the dashboard
I am trying to integrate Datadog logs into my project and trying to use Hilt DI for the setup.
Below code is my app module
@Provides
@Singleton
fun provideDatadogLogger(): Logger {
...
5
votes
1
answer
109
views
Hilt Navigation Compose and ViewModel
I tried to follow the examples in the android documentation but I can't implement the navigation using Navigation Compose, ViewModel and Hilt. No errors are thrown and in the NavigationScreen ...
0
votes
0
answers
29
views
Get Initializer result from Hilt module
Simple question here: is it possible to get an object initilized through app startup Initializer inside a Hilt module?
Let me provide an example. Assume that I've the following Initializer:
class ...
0
votes
0
answers
204
views
Create HiltViewModel with custom ViewModelStoreOwner
I have this compose code who works perfectly:
val pagerVM = hiltViewModel(
creationCallback = { factory: JourneySummaryPagerViewModel.Factory ->
factory.create(selectedIndex.value)
}...
1
vote
1
answer
50
views
What is the right way to insert records with 1:N and N:M relationships in a Room database using MVVM?
I'm a newbie using MVVM and Kotlin + Jetpack Compose + Room + Hilt, etc. I want to learn how to do things in the right way, and I'm getting into trouble with so much information.
I have the following ...
3
votes
1
answer
2k
views
I am struggling compiling Android project in Android Studio with Dagger/Hilt and Proguard
So I am pretty new to Android Studio, and Android development; my background is Java fullstack.
I started by creating a default template from Android Studio and moved my code (and code from a dagger ...