title: How to correctly create a app wise ViewModel with SavedStateHandle as parameter
body: <p>I’m declaring a ViewModel with SavedStateHandle as parameter in koin modules</p>
  
  <ol>
  <li>in koin modules</li>
  </ol>
  
  <pre class="lang-kotlin prettyprint-override"><code>viewModel { (handle: SavedStateHandle) -&gt; CacheProvider(handle) }
  
  viewModel { SomeFragmentUsedViewModel(get()) }
  </code></pre>
  
  <ol start="2">
  <li>And initiate it in Activity</li>
  </ol>
  
  <pre><code>lateinit var cacheProvider: CacheProvider
  
  </code></pre>
  
  <ol start="3">
  <li>Reuse it in SomeFragment</li>
  </ol>
  
  <pre><code>private val viewModel: SomeFragmentUsedViewModel by inject()
  
  private val cacheProvider: CacheProvider by sharedViewModel()
  </code></pre>
  
  <ol start="4">
  <li>When navigating into SomeFragment, app crashed when accessing to both ViewModel:</li>
  </ol>
  
  <pre><code>2020-04-30 22:04:04.858 26677-26677/com.ncbportal.sit E/[Koin]: Instance creation error : could not create instance for [Factory:'com.ncb.common.viewmodel.CacheProvider']: org.koin.core.error.NoParameterFoundException: Can't get parameter value #0 from org.koin.core.parameter.DefinitionParameters@a37a822
          org.koin.core.parameter.DefinitionParameters.elementAt(DefinitionParameters.kt:32)
          org.koin.core.parameter.DefinitionParameters.component1(DefinitionParameters.kt:34)
          com.ncbportal.di.ViewModelModuleKt$viewModelModule$1$77.invoke(Unknown Source:11)
          com.ncbportal.di.ViewModelModuleKt$viewModelModule$1$77.invoke(Unknown Source:4)
          org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:50)
          org.koin.core.instance.FactoryInstanceFactory.get(FactoryInstanceFactory.kt:36)
          org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:87)
          org.koin.core.scope.Scope.resolveInstance(Scope.kt:214)
          org.koin.core.scope.Scope.get(Scope.kt:181)
          com.ncbportal.di.ViewModelModuleKt$viewModelModule$1$76.invoke(ViewModelModule.kt:117)
          com.ncbportal.di.ViewModelModuleKt$viewModelModule$1$76.invoke(Unknown Source:4)
          org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:50)
          org.koin.core.instance.FactoryInstanceFactory.get(FactoryInstanceFactory.kt:36)
          org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:87)
          org.koin.core.scope.Scope.resolveInstance(Scope.kt:214)
          org.koin.core.scope.Scope.get(Scope.kt:181)
          com.ncbportal.deposit.fragment.ApplyTermDepositFragment$$special$$inlined$inject$1.invoke(ComponentCallbackExt.kt:51)
          kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81)
  
  
  2020-04-30 22:04:04.861 26677-26677/com.ncbportal.sit E/[Koin]: Instance creation error : could not create instance for [Factory:'com.ncbportal.deposit.viewmodel.ApplyTermDepositViewModel']: org.koin.core.error.InstanceCreationException: Could not create instance for [Factory:'com.ncb.common.viewmodel.CacheProvider']
          org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:59)
          org.koin.core.instance.FactoryInstanceFactory.get(FactoryInstanceFactory.kt:36)
          org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:87)
          org.koin.core.scope.Scope.resolveInstance(Scope.kt:214)
          org.koin.core.scope.Scope.get(Scope.kt:181)
          com.ncbportal.di.ViewModelModuleKt$viewModelModule$1$76.invoke(ViewModelModule.kt:117)
          com.ncbportal.di.ViewModelModuleKt$viewModelModule$1$76.invoke(Unknown Source:4)
          org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:50)
          org.koin.core.instance.FactoryInstanceFactory.get(FactoryInstanceFactory.kt:36)
          org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:87)
          org.koin.core.scope.Scope.resolveInstance(Scope.kt:214)
          org.koin.core.scope.Scope.get(Scope.kt:181)
          com.nextbank.ncbportal.deposit.fragment.ApplyTermDepositFragment$$special$$inlined$inject$1.invoke(ComponentCallbackExt.kt:51)
          kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81)
  </code></pre>
  
  <p>Search all around koin repo issues it seems not definite way of creating a app-wise ViewModel (CacheProvider in my case) for all fragments and ViewModel to access.</p>
  
  <p>Does anyone have any clue about this?</p>