title: Unable to Inject ViewModel from a different module in Android project
body: <p>I am not sure if this is a limitation of the Dagger Hilt library, but i seem to be unable to inject a ViewModel from a different module in activity.</p>
  <pre><code>Project:
    :modA (OrderViewModel with @HiltViewModel annotation)
    :modUI (DI stuff here that injects OrderViewModel in Activity) with dependency on modA
    :modOther
  </code></pre>
  <pre><code>@HiltViewModel
  class OrderViewModel @Inject constructor(
      private val loadOrdersUseCase: LoadOrdersUseCase,
      private val updateOrderUseCase: UpdateOrderUseCase,
      private val mapper: OrderDataMapper,
  ) : SharedViewModel&lt;OrderDataModel&gt;() 
  </code></pre>
  <p>which is injected like:</p>
  <pre class="lang-java prettyprint-override"><code>
  private val orderViewModel: OrderViewModel by viewModels()
  </code></pre>
  <p>I can't see the respective <code>OrderViewModel_HiltModules</code> and <code>OrderViewModel_HiltModules</code> classes generated. In fact, when I ran the app it crashes with crash below, which indicates, their ViewModel is not in the ViewModel keymap that hilt should have created.</p>
  <pre><code>Caused by: java.lang.RuntimeException: Cannot create an instance of class com.rowland.delivery.presentation.viewmodels.order.OrderViewModel
  .
  .
  .
  Caused by: java.lang.InstantiationException: java.lang.Class&lt;com.rowland.delivery.presentation.viewmodels.order.OrderViewModel&gt; has no zero argument constructor
          at java.lang.Class.newInstance(Native Method)
          at androidx.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:219)
  </code></pre>
  <p>Is this a limitation of Dagger Hilt? Any insights would be appreciated.</p>
  <p>For anyone who has the time to reproduce it, you can take a look at the following branch of the code:</p>
  <ul>
  <li><a href="https://github.com/RowlandOti/E-CommerceApp-Merchant/tree/refactoring" rel="nofollow noreferrer">https://github.com/RowlandOti/E-CommerceApp-Merchant/tree/refactoring</a></li>
  </ul>