title: Dagger2 + Kotlin: lateinit property has not been initialized
body: <p>I'm trying to inject the ViewModelFactory into my Activity, but it keeps throwing this same error: lateinit property viewModelFactory has not been initialized. I can't find what I may be doing wrong. See the code above from my classes</p>
  
  <p>AppComponent.kt</p>
  
  <pre><code>@Component(modules = [(AppModule::class), (NetworkModule::class), (MainModule::class)])
  interface AppComponent {
  
      fun inject(application: TweetSentimentsApplication)
  
      fun inject(mainActivity: MainActivity)
  
      fun context(): Context
  
      fun retrofit(): Retrofit
  }
  </code></pre>
  
  <p>MainModule.kt</p>
  
  <pre><code>@Module
  class MainModule {
  
      @Provides
      fun mainViewModelFactorty(repository: TweetRepository): MainViewModelFactory = MainViewModelFactory(repository)
  
      @Provides
      fun local(database: AppDatabase): TweetLocal = TweetLocal(database)
  
      @Provides
      fun remote(tweetService: TweetService): TweetRemote = TweetRemote(tweetService)
  
      @Provides
      fun tweetService(retrofit: Retrofit): TweetService = retrofit.create(TweetService::class.java)
  
      @Provides
      fun repository(local: TweetLocal, remote: TweetRemote): TweetRepository = TweetRepository(local, remote)
  
  }
  </code></pre>
  
  <p>MainActivity.kt</p>
  
  <pre><code>class MainActivity : AppCompatActivity() {
  
      @Inject lateinit var viewModelFactory: MainViewModelFactory
  
      private val viewModel: MainViewModel? = null
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.main_activity)
  
          ViewModelProviders.of(this, viewModelFactory).get(MainViewModel::class.java)
  
          viewModel?.init("guuilp")
          viewModel?.getTweetList()?.observe(this, Observer {
              Toast.makeText(this, it?.size.toString(), Toast.LENGTH_LONG).show()
          })
      }
  }
  </code></pre>
  
  <p>TweetSentimentsApplication.kt</p>
  
  <pre><code>open class TweetSentimentsApplication: Application(){
  
      companion object {
          lateinit var appComponent: AppComponent
      }
  
      override fun onCreate() {
          super.onCreate()
  
          initDI()
      }
  
      private fun initDI() {
          appComponent = DaggerAppComponent.builder()
                  .appModule(AppModule(this))
                  .build()
      }
  }
  </code></pre>