galex
09/24/2025, 6:03 PM@DefaultHttpClient I had no problem bringing a specific dependency in a constructor of a class:
@Single
internal class FirebaseAuthImpl(
private val firebase: Firebase,
private val firebaseSettings: Lazy<FirebaseSettings>,
@param:DefaultHttpClient val httpClient: Lazy<HttpClient>,
private val json: Lazy<Json>,
) : FirebaseAuth { ... }
Now, using the same annotation in a function misses the annotation:
@Single
fun provideFirebaseAuth(
firebaseApp: FirebaseApp,
firebaseSettings: Lazy<FirebaseSettings>,
@DefaultHttpClient httpClient: Lazy<HttpClient>,
json: Lazy<Json>,
): FirebaseAuth {
return createFirebaseAuth(
firebaseApp = firebaseApp,
firebaseSettings = firebaseSettings,
httpClient = httpClient,
json = json,
)
}
The error is the following:
[ksp] --> Missing Definition for property 'httpClient : io.ktor.client.HttpClient' in 'com.domain.app.di.provideFirebaseAuth'. Fix your configuration: add definition annotation on the class.
What am I missing? π€galex
09/24/2025, 6:14 PM2.1.0 because if I remove arg("KOIN_CONFIG_CHECK", "true") from the app, it then builds and run smoothlygalex
09/25/2025, 5:39 AM2.2.0-RC1, the issue still exists and another one appears that doesn't appear in `2.1.0`:
Caused by: java.lang.IllegalStateException: can't find definition metadata for ComCompanyServicesUserDomainObserveCurrentUserUseCase on org.koin.ksp.generated._KSP_ComCompanyServicesUserDomainObserveCurrentUserUseCase
at org.koin.compiler.verify.KoinConfigChecker.verifyDefinition(KoinConfigChecker.kt:244)
at org.koin.compiler.verify.KoinConfigChecker.verifyDefinition(KoinConfigChecker.kt:210)
at org.koin.compiler.verify.KoinConfigChecker.verify(KoinConfigChecker.kt:93)
at org.koin.compiler.BuilderProcessor.process(BuilderProcessor.kt:118)
at com.google.devtools.ksp.impl.KotlinSymbolProcessing$execute$1$1.invoke(KotlinSymbolProcessing.kt:562)
at com.google.devtools.ksp.impl.KotlinSymbolProcessing$execute$1$1.invoke(KotlinSymbolProcessing.kt:560)
at ksp.com.google.devtools.ksp.common.IncrementalContextBase.closeFilesOnException(IncrementalContextBase.kt:400)
at com.google.devtools.ksp.impl.KotlinSymbolProcessing.execute(KotlinSymbolProcessing.kt:560)
The module setup is pretty simple, like any other one:
@Module
@Configuration
@ComponentScan("com.company.services.user")
class UserServiceModule
With the class being setup as
@Single
internal class ObserveCurrentUserUseCaseImpl(
private val authRepository: AuthRepository,
private val userRepository: UserRepository,
) : ObserveCurrentUserUseCase { ... }
Any help would be greatly appreciated πarnaud.giuliani
09/29/2025, 1:18 PMgalex
09/30/2025, 6:51 AM2.1.0 using the @Provided animation to fix that specific issue.
It would be very nice to see an example of how to set 2.2.0 in a multi-module project using @Configuration only (without enabling the default module) where some dependencies are defined only at the app level and where other modules are using interfaces of those dependencies πarnaud.giuliani
10/07/2025, 3:08 PMBart
10/17/2025, 8:46 PMarnaud.giuliani
10/21/2025, 6:24 AMBart
10/21/2025, 9:33 PM@KoinApplication.
When analyzed the generated code for KoinApp.startKoin, it not adds DataModule().module in koinConfiguration() to modules() call - same as in my project. However, in example-cmp DI works, while in my project I'm getting org.koin.core.error.NoDefinitionFoundException for missing dependency from gradle module if I not put the koin module explicitly in @KoinApplication to force the generated koinConfiguration() to add it π€.arnaud.giuliani
10/22/2025, 6:43 AMBart
10/22/2025, 6:49 AMimplementation(project(":my-module"))arnaud.giuliani
10/22/2025, 6:50 AMBart
10/22/2025, 7:12 AMbuildSrc so need some time for additional work, will try in the evening or tomorrow and will let U know, thanks!Bart
10/22/2025, 6:28 PM@Module(includes = [DataModule::class, ...]) and it not uses @Configuration on DataModule (which is in separate gradle module) for automatic loading in @KoinApplication.
Annotating DataModule with @Configuration still not enables auto wiring, and we need to include it anyway manually, e.g. in ViewModelModule or AppModule like in current example code.
Updated my project in similar way to add module includes where they are needed and it works now without providing modules in @KoinApplication, however @Configuration in other gradle modules than main app is not needed as not works for the purpose of auto module wiring.
I'll explore later how @Configuration works in multi-module projects for configuration management purpose.galex
10/23/2025, 6:58 AMBart
10/23/2025, 7:25 AMgalex
10/23/2025, 7:35 AMarnaud.giuliani
10/23/2025, 3:00 PMarnaud.giuliani
10/23/2025, 3:01 PMarnaud.giuliani
10/23/2025, 3:02 PMBart
10/23/2025, 3:59 PMBart
10/23/2025, 4:45 PMBart
10/23/2025, 4:49 PMyes, the current example-cmp could use @Configuration in data moduleCan you provide the example branch on how
example-cmp would look with @Configuration used to wire the DataModule ?arnaud.giuliani
10/24/2025, 6:56 AMarnaud.giuliani
10/24/2025, 7:25 AMarnaud.giuliani
10/24/2025, 7:25 AM