arnaud.giuliani
06/13/2025, 4:56 PMarnaud.giuliani
06/13/2025, 4:57 PMJonathan
06/13/2025, 8:47 PM@OptIn(ExperimentalPagingApi::class)
This declaration needs opt-in. Its usage must be marked with ‘@androidx.paging.ExperimentalPagingApi’ or ‘@OptIn(androidx.paging.ExperimentalPagingApi::class)’Does Koin not support transitive Opt-in annotations? How are other people solving this issue?
dazza5000
06/16/2025, 7:34 PMsimon.vergauwen
06/25/2025, 8:46 AMonClose
work on Desktop besides manually calling koin.close()
from a ShutdownHook?Mario Andhika
06/26/2025, 8:03 AMFarhazul Mullick
06/26/2025, 10:47 AMex: startKoin{
module{
singe { ClassA(get()) }
}
}
Farhazul Mullick
06/27/2025, 9:23 AMkoin.waitAllStartJobs()
Tim Karagosian
06/28/2025, 9:01 PMKazik
07/01/2025, 9:58 AMinterface RequestParser
@Single
class AImpl : RequestParser
@Single
class BImpl : RequestParser
@Single
class Repository(private val parsers: Set<RequestParser>)
Eugen Martynov
07/01/2025, 3:39 PMjava.lang.IllegalStateException: Wrong Scope qualifier: trying to open instance ...
Eugen Martynov
07/01/2025, 3:39 PMRoger Kreienbühl
07/07/2025, 5:48 AM@Single
:
package com.example.data.mapper
import org.koin.core.annotation.Single
@Single
class XyzDtoMapper {
...
}
I try to scan for this class with a module defined inside the server gradle module:
package com.example.di
import org.koin.core.annotation.ComponentScan
import org.koin.core.annotation.Module
@Module
@ComponentScan("com.example.data.mapper")
class MapperModule
Is such a Scan over multiple gradle modules possible, and if do, how can I achieve this?
The Mapper module is generated but the XyzDtoMapper
is not present in it.Suresh Maidaragi
07/08/2025, 9:14 AMkoinInject<xx-viewmodel>()
is composable lifecycle aware?reactormonk
07/08/2025, 4:08 PMget()
, but then the injected code reuses the implementation. Can I somehow forward the injection to the actual call site, so an object is being created on each invocation?FlowFan
07/15/2025, 2:31 AMkoin-annotations
?
// commonMain
interface GenerativeModel {
suspend fun generateTextContent(prompt: String): String?
suspend fun generateJsonContent(prompt: String): String?
suspend fun generateImage(prompt: String): ByteArray?
}
// iosMain
fun initialiseKoin(generativeModel: GenerativeModel) {
startKoin {
modules(
module { single<GenerativeModel> { generativeModel } }
)
}
}
// swift
@main
struct iOSApp: App {
init() {
initialiseKoin(generativeModel: GenerativeModelIOS())
}
}
arnaud.giuliani
07/17/2025, 7:45 AM4.1.1-Beta1
https://github.com/InsertKoinIO/koin/pull/2249Thierry Kh
07/17/2025, 12:48 PMval getSomeUseCase: GetSomeUseCase = getKoin().get()
Or it should be working but i need to fix something.Pedro Francisco de Sousa Neto
07/22/2025, 12:40 AMSavedStateHandle
in a @KoinViewModel
injected in a composable
function?
Version
koin-bom = "4.1.0"
koin-annotations = "2.1.0"
kotzilla = "1.2.0-Beta1"
kotzillaPlugin = "1.2.0-Beta2"
Caused by: org.koin.core.error.NoDefinitionFoundException: No definition found for type 'androidx.lifecycle.SavedStateHandle'. Check your Modules configuration and add missing type and/or qualifier!
When I remove the SavedStateHandle
from my ViewModel, everything works fine.Pedro Francisco de Sousa Neto
07/23/2025, 6:15 PMViewModel
intialization.
I've shared my ViewModel
constructor above. And now I'm sharing the other dependencies.
GetUsers.kt
@Factory
class GetUsers(
private val dao: UserDao
)
AppModule.kt
@Module
@ComponentScan("br.com.velantasistemas.mymoney")
class AppModule {
@Single
fun getAppDatabase(): AppDatabase {
return get(AppDatabase::class.java)
}
@Single
fun getUserDao(): UserDao {
return getAppDatabase().userDao()
}
}
DatabaseModule.kt
object DatabaseModule {
val module = module {
single<AppDatabase> {
val context: Context = get()
return@single Room.databaseBuilder(
context,
AppDatabase::class.java, "database-name"
)
.allowMainThreadQueries()
.fallbackToDestructiveMigration(dropAllTables = true)
.build()
}
}
}
Questions:
1. How can I speed this up?
2. Could allowMainThreadQueries
be the reason for this slowdown?
3. Do you think this is a good way to handle database and DAO access?
a. I know it's a matter of preference, but I'd really like to hear your thoughts, folks.
4. I remember using Koin's suspend initialization before.
a. Does it help only during app startup, or could it also be beneficial for initializing singletons like the database in this case?Laurent Thiebaud
07/24/2025, 9:15 AMOsnir Mesquita
07/28/2025, 9:15 PMLaurent Thiebaud
07/30/2025, 3:05 PMkoinApplication
, I inject some services within (using single
and declare
)
On runtime I inject other services using by inject<...>()
Then when injected service is resolved, I have error KoinApplication has not been started
It seems it tries to resolve other services using the global context
Should I inject other services always using the koinApplication
instance? (if so this is extremely boring)
(this is next to my other question here)Jonathan
07/31/2025, 6:37 PMABRAR WIRYAWAN
08/07/2025, 3:56 AMEdgar Avuzi
08/08/2025, 3:10 AMAbhimanyu
08/08/2025, 5:37 PMjava.lang.IllegalStateException: KoinApplication has not been started
Pedro Francisco de Sousa Neto
08/09/2025, 2:45 PMPedro Francisco de Sousa Neto
08/12/2025, 12:03 AMAlexey
08/12/2025, 4:09 AMactual val dataStoreModule: Module = module {
single {
createProfileDataStore {
createAndroidFilePath(get(), "profile.json")
}
}
single {
createSettingsDataStore {
createAndroidFilePath(get(), "settings.json")
}
}
}
But if i add named, all works good, it good practice, or u have better way for provide 2 different datastore in kmp? In hilt(android native) works good without named param
enum class DataStoreType {
Profile,
Settings
}
actual val datastoreModule: Module = module {
single<DataStore<ProfileDto>>(
named(DataStoreTypes.Profile)
) {
createProfileDataStore {
createAndroidFilePath(get(), "profile.json")
}
}
single<DataStore<SettingsDto>>(
named(DataStoreTypes.Settings)
) {
createTokensDataStore {
createAndroidFilePath(get(), "settings.json")
}
}
}