title: Android Hilt - multi module project cast error
body: <p>I am trying to use hilt for my project which contains dynamic features. I am facing an error that I cannot fully understand why. I get an error like this:</p>
  <pre><code>java.lang.ClassCastException: com.social.analysis.DaggerApp_HiltComponents_ApplicationC$ActivityRetainedCImpl$ActivityCImpl$FragmentCImpl cannot be cast to com.social.login.intro.IntroFragment_GeneratedInjector
      at com.social.login.intro.Hilt_IntroFragment.inject(Hilt_IntroFragment.java:94)
      at com.social.login.intro.Hilt_IntroFragment.initializeComponentContext(Hilt_IntroFragment.java:58)
      at com.social.login.intro.Hilt_IntroFragment.onAttach(Hilt_IntroFragment.java:50)
      at androidx.fragment.app.Fragment.onAttach(Fragment.java:1602)
      at com.social.login.intro.Hilt_IntroFragment.onAttach(Hilt_IntroFragment.java:40)
  </code></pre>
  <p><strong>My ViewModel in LOGİN MODULE (dynamic features)</strong></p>
  <pre><code>class IntroViewModel @Inject constructor(): ViewModel() {
  // TODO: Implement the ViewModel
  }
  </code></pre>
  <p><strong>My Fragment in LOGIN MODULE</strong></p>
  <pre><code>@AndroidEntryPoint
  class IntroFragment : BaseFragment&lt;FragmentIntroBinding, IntroViewModel&gt;(
  R.layout.fragment_intro
  ) {
  
  companion object {
      fun newInstance() = IntroFragment()
  }
  
  override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
      super.onViewCreated(view, savedInstanceState)
  }
  
  override fun onInitDataBinding() {
      viewBinding.viewModel = viewModel
  }
  }
  </code></pre>
  <p><strong>My Base Fragment in UI Module</strong></p>
  <pre><code>abstract  class BaseFragment &lt;B: ViewDataBinding, M: ViewModel&gt;(
  @LayoutRes
  private val layoutId: Int
  ): Fragment() {
  
  @Inject
  lateinit var viewModel: M
  lateinit var viewBinding: B
  ...
  </code></pre>
  <p><strong>My Application Class in App Module</strong></p>
  <pre><code>@HiltAndroidApp
  class App : SplitCompatApplication() {
  }
  </code></pre>
  <p><strong>My Main Activity in App Module</strong></p>
  <pre><code>@AndroidEntryPoint
  class MainActivity : AppCompatActivity() 
  </code></pre>
  <p>I call the IntroFragment from the App module. Then the application crashes.</p>
  <p>The project structure looks like this:</p>
  <p><a href="https://i.stack.imgur.com/hcMjJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hcMjJ.png" alt="Project Structure" /></a></p>