title: Android Hilt with ViewModel scoped to Navgraph, Provider Factory issue
body: <p>I am using <strong>Hilt</strong> for <strong>Dependency Injection</strong> specially for injecting into <strong>ViewModel</strong>.
  Also wanted to <strong>scope ViewModel to NavGraph</strong>. To do this, got the <strong>ViewModelStoreOwner</strong> by passing the <strong>NavGraph</strong> and now creating <strong>ViewModel</strong> by passing the <strong>store instance provided by the navgraph</strong> to <strong>ViewModelProvider</strong>. The problem I'm facing is, as I'm passing only the <strong>store instance</strong> to get the <strong>ViewModelProvider</strong> without any <strong>Factory</strong>, since <strong>Hilt</strong> will implement that, I'm getting build error <strong>has no zero argument constructor</strong>. When saw the source code I found that as I'm providing only <strong>store instance</strong> as an argument and no factory, <strong>a simple factory is being provided automatically</strong> and as the <strong>provided factory has no arguments</strong>, hence this error.</p>
  <p><strong>How to solve this?</strong></p>
  <p><strong>The method being called from source (ViewModelProvider.java)</strong>-</p>
  <pre><code>     * Creates {@code ViewModelProvider}. This will create {@code ViewModels}
       * and retain them in a store of the given {@code ViewModelStoreOwner}.
       * &lt;p&gt;
       * This method will use the
       * {@link HasDefaultViewModelProviderFactory#getDefaultViewModelProviderFactory() default factory}
       * if the owner implements {@link HasDefaultViewModelProviderFactory}. Otherwise, a
       * {@link NewInstanceFactory} will be used.
       */
      public ViewModelProvider(@NonNull ViewModelStoreOwner owner) {
          this(owner.getViewModelStore(), owner instanceof HasDefaultViewModelProviderFactory
                  ? ((HasDefaultViewModelProviderFactory) owner).getDefaultViewModelProviderFactory()
                  : NewInstanceFactory.getInstance());
      }
  </code></pre>
  <p><strong>My ViewModel Class that requires dependency injection</strong>-</p>
  <pre><code>    private Repository repository;
      private MutableLiveData&lt;FeatureCollection&gt; featureCollection = new MutableLiveData&lt;&gt;();
      private MutableLiveData&lt;Boolean&gt; loading = new MutableLiveData&lt;&gt;();
      private Disposable disposable;
  
  
      @ViewModelInject
      public QuakeListViewModel(Repository repository) {
          this.repository = repository;
      }
  </code></pre>
  <p><strong>My Fragment class</strong>-</p>
  <pre><code>    private FragmentQuakeListBinding _binding;
      private QuakeListViewModel _viewModel;
      private ViewModelStoreOwner viewModelStoreOwner;
      private NavController _navController;
   @Override
      public void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          _navController = NavHostFragment.findNavController(this);
          viewModelStoreOwner =  _navController.getViewModelStoreOwner(R.id.main_nav_graph);
  
      }
  </code></pre>
  <pre><code>public View onCreateView(@NotNull LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          //other implementation
          _viewModel = new ViewModelProvider(viewModelStoreOwner).get(QuakeListViewModel.class);
          //return binding.root
      }
  </code></pre>
  <p><strong>Any help would be appreciated</strong></p>
  <p>Thanks</p>