title: Kodein Framework - property delegate must have a provideDelegate(...) method
body: <p>I'm trying to build an app with the following architecture: LoginActivity -> MainActivity -> everything else handled in fragments hosted by MainActivity. I'm also using the Kodein Framework for the first time and get the following error in my starting fragment: </p>
  
  <blockquote>
    <p>Property delegate must have a 'provideDelegate(HomeFragment,
    KProperty*>' method. None of the following functions is suitable. 
    provideDelegate(Context [highlighted in red], KProperty&lt;<em>>?) defined
    in org.kodein.di.android.KodeinPropertyDelegateProvider Type
    'KodeinPropertyDelegateProvider' has no method
    'getValue(HomeFragment, KProperty&lt;</em>>)' and thus it cannot serve as a
    delegate</p>
  </blockquote>
  
  <p>This is my code so far:</p>
  
  <pre><code>class HomeFragment : Fragment(), KodeinAware {
  
  override val kodein by kodein()
  private val factory : MainViewModelFactory by instance()
  private lateinit var viewModel: MainViewModel
  
  override fun onCreateView(
      inflater: LayoutInflater, container: ViewGroup?,
      savedInstanceState: Bundle?
  ): View? {
      // Inflate the layout for this fragment
      val binding : FragmentHomeBinding = FragmentHomeBinding.inflate(inflater, container, false)
  
      viewModel = ViewModelProviders.of(this, factory).get(MainViewModel::class.java)
      binding.viewModel = viewModel
  
      return binding.root
  }
  </code></pre>
  
  <p>}</p>
  
  <p>How can I fix this?</p>
  
  <p>Thanks :)</p>