title: HILT : lateinit property repository has not been initialized in ViewModel
body: <p>I am facing this issue in multi module android project with HILT.</p>
  <pre><code> kotlin.UninitializedPropertyAccessException: lateinit property repository has not been initialized in MyViewModel
  </code></pre>
  <p>My modules are</p>
  <ol>
  <li>App Module</li>
  <li>Viewmodel module</li>
  <li>UseCase Module</li>
  <li>DataSource Module</li>
  </ol>
  <p><strong>'App Module'</strong></p>
  <pre><code>@AndroidEntryPoint
  class MainFragment : Fragment() {
  private lateinit var viewModel: MainViewModel
  override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                            savedInstanceState: Bundle?): View {
      return inflater.inflate(R.layout.main_fragment, container, false)
  }
  override fun onActivityCreated(savedInstanceState: Bundle?) {
      super.onActivityCreated(savedInstanceState)
      viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
      viewModel.test()
  }}
  </code></pre>
  <p><strong>'ViewModel Module'</strong></p>
  <pre><code>class MainViewModel @ViewModelInject constructor(private val repository: MyUsecase): ViewModel() {
  fun test(){
      repository.test()
  }}
  </code></pre>
  <p><strong>'UseCase Module'</strong></p>
  <pre><code>class MyUsecase @Inject constructor() {
  
  @Inject
  lateinit var feature: Feature
  
  fun doThing() {
      feature.doThing()
  }
  
  @Module
  @InstallIn(ApplicationComponent::class)
  object FeatureModule {
      @Provides
      fun feature(realFeature: RealFeature): Feature = realFeature
  }
  }
  </code></pre>
  <p><strong>'DataSource Module'</strong></p>
  <pre><code>interface Feature {
  fun doThing()
  }
  
  class RealFeature : Feature {
  override fun doThing() {
      Log.v(&quot;Feature&quot;, &quot;Doing the thing!&quot;)
  }
  }
  </code></pre>
  <p>Dependencies are</p>
  <p>MyFragment ---&gt; MyViewModel ---&gt; MyUseCase ---&gt; DataSource</p>
  <p>what i did wrong with this code pls correct it.</p>