title: How to inject app: Context in ViewModel with Hilt?
body: <p><strong>Hello, I'm trying to inject view model using Hilt, but I get the following error:</strong></p>
  <pre><code> E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.wordssample, PID: 25250
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.wordssample/com.example.wordssample.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.example.wordssample.MainViewModel
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2426)
    
   Caused by: java.lang.RuntimeException: Cannot create an instance of class com.example.wordssample.MainViewModel
      at androidx.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:221)
      at androidx.lifecycle.ViewModelProvider$AndroidViewModelFactory.create(ViewModelProvider.java:278)
      at androidx.lifecycle.SavedStateViewModelFactory.create(SavedStateViewModelFactory.java:106)
      at androidx.hilt.lifecycle.HiltViewModelFactory.create(HiltViewModelFactory.java:74)
      at androidx.lifecycle.AbstractSavedStateViewModelFactory.create(AbstractSavedStateViewModelFactory.java:69)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 
  </code></pre>
  <p><strong>This is my MainActivity:</strong></p>
  <pre><code>@AndroidEntryPoint
  class MainActivity : AppCompatActivity() {
     
      private val viewModel  by viewModels&lt;MainViewModel&gt;()
  
  
      override fun onCreate(savedInstanceState: Bundle?) {
        ....
  </code></pre>
  <p><strong>And this is the ViewModel class I'm trying to inject</strong></p>
  <pre><code>class MainViewModel @ViewModelInject constructor(
      @ApplicationContext application: Context,
      @Assisted private val savedStateHandle: SavedStateHandle
  ) : ViewModel() {
  
      private val repositorio = WordRepositorio(application)
  
      val allWords = repositorio.mAllWords
  ...
  </code></pre>
  <p>I appreciate the help!
  Thanks</p>