title: Super type initialization is impossible without primary constructor in android kotlin mvvm
body: <p><strong>What i am trying to do:</strong></p>
  
  <p>I am trying to link viewModel into activity and use a factory in between</p>
  
  <p>In the <strong>MainActivity.kt</strong></p>
  
  <pre><code>KtMainActivityViewModelFactory    ktMainActivityViewModel = ViewModelProviders.of(this,ktMainActivityViewModelFactory).get(KtMainActivityViewModel::class.java)
  </code></pre>
  
  <p><strong>KtMainActivityViewModelFactory.kt</strong></p>
  
  <pre><code>class KtMainActivityViewModelFactory : ViewModelProvider.Factory {
  
  
      private val movieRepository: MovieRepository
      private val database: MoviesAppDatabase
      private val dataservice: MovieDataService
  
      @Inject
      constructor(movieRepository: MovieRepository, database: MoviesAppDatabase, dataservice: MovieDataService) {
          this.movieRepository = movieRepository
          this.database = database
          this.dataservice = dataservice
      }
  
  
      override fun &lt;T : ViewModel&gt; create(modelClass: Class&lt;T&gt;): T {
          return KtMainActivityViewModelFactory(movieRepository, database, dataservice) as T
      }
  
  
  }
  </code></pre>
  
  <p><strong>KtMainActivityViewModel.kt</strong></p>
  
  <pre><code>class KtMainActivityViewModel : ViewModel() {
  
  
      private val movieRepository: MovieRepository
      private val database: MoviesAppDatabase
      private val dataservice: MovieDataService
  
  
      constructor(movieRepository: MovieRepository, database: MoviesAppDatabase, dataservice: MovieDataService) : super() {
          this.movieRepository = movieRepository
          this.database = database
          this.dataservice = dataservice
      }
  
  
  }
  </code></pre>
  
  <p><strong>Error:</strong>
  <a href="https://i.stack.imgur.com/uyyre.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uyyre.png" alt="enter image description here"></a></p>