override val kodein = Kodein.lazy {
import(androidXModule(this@ForecastApplication))
bind() from singleton { ForecastDatabase(instance()) }
bind() from singleton { instance<ForecastDatabase>().currentWeatherDao() }
bind<ConnectivityInterceptor>() with singleton { ConnectivityInterceptorImpl(instance()) }
bind() from singleton { WeatherStackApiService(instance()) }
bind<WeatherNetworkDataSource>() with singleton { WeatherNetworkDataSourceImpl(instance()) }
bind<ForecastRepository>() with singleton { ForecastRespositoryImpl(instance(), instance()) }
bind() from provider { CurrentWeatherViewModelFactory(instance()) }
}
override fun onCreate() {
super.onCreate()
AndroidThreeTen.init(this)
}
}`
`override val kodein by closestKodein()
private val viewModelFactory: CurrentWeatherViewModelFactory by instance()
private lateinit var viewModel: CurrentWeatherViewModel
i'm facing while working with weather forecast implemented as done in tutorial since then i'm facing kodein binding issue
Issue: org.kodein.di.Kodein$NotFoundException: No binding found for bind() with ?().? { ? }
`class ForecastApplication : Application(), KodeinAware {
}`
`override val kodein by closestKodein() private val viewModelFactory: CurrentWeatherViewModelFactory by instance() private lateinit var viewModel: CurrentWeatherViewModel
viewModel = ViewModelProvider(this, viewModelFactory) .get(CurrentWeatherViewModel::class.java)
`
Kodien version : 6.5.4