Kotlin's Koin Dependency Injection Not Recognizing Scoped Beans in ViewModel
I'm trying to configure I need some guidance on I'm working with an scenario where Koin is not recognizing scoped beans when used inside a ViewModel. I'm using Koin version 3.1.4 and have set up my dependency injection in a fairly standard way. I have a ViewModel that requires a service to fetch data, and the service is defined as a scoped bean. However, when I try to get the service instance in the ViewModel, I get a `No declaration found for ...` behavior. Hereβs how I have defined my Koin module: ```kotlin val appModule = module { single { MyRepository() } scope(named("myScope")) { scoped { MyService(get()) } } } ``` The ViewModel is created in the fragment and bound to the scope like this: ```kotlin class MyViewModel(val service: MyService) : ViewModel() { // ViewModel logic here } class MyFragment : Fragment() { private val viewModel: MyViewModel by viewModel(scope = named("myScope")) } ``` Iβve ensured that the `MyFragment` is being launched within the correct scope, but the service isn't being injected correctly. I've also tried calling `get<MyService>()` directly in the ViewModel, but it results in the same behavior. I checked the Koin documentation and made sure to include the necessary dependencies in my build.gradle file. I've also cleared the cache and rebuilt the project multiple times, but the behavior continues. What could be going wrong here? Am I missing any specific configuration or best practice for using scoped beans in ViewModels with Koin? For context: I'm using Kotlin on Ubuntu 20.04. I'm using Kotlin 3.11 in this project. Could this be a known issue?