Alejandro Rios
03/21/2025, 12:45 PMshared
module in charge of the network part using Koin 4.0.1
for DI, Android is working ok, but iOS is throwing this error message:
shared.KoinInitHelper#initKoin(){}. The file path does not exist on the file system: /<compiler-generated>
Not sure why the error happens, any idea how to solve this? code in 🧵Alejandro Rios
03/21/2025, 12:45 PMiosMain
class KoinInitHelper : KoinComponent {
private val appCoroutineDispatchers: AppCoroutineDispatchers by inject()
private val repository: DogRepository by inject()
fun appCoroutineDispatchers(): AppCoroutineDispatchers = appCoroutineDispatchers
fun dogRepository(): DogRepository = repository
fun initKoin() {
startKoin {
modules(sharedDomainModule, sharedNetworkModule)
}
}
}
Alejandro Rios
03/21/2025, 12:48 PMimport SwiftUI
import Shared
@main
struct dogifyApp: App {
init() {
KoinInitHelper().doInitKoin()
}
var body: some Scene {
WindowGroup {
HomeView()
}
}
}
I also tried leaving the initKoin
method outside the class and calling that with KoinInitHelperKt.doInitKoin()
but I'm getting the same errorAlejandro Rios
03/24/2025, 11:10 PM