title: Kotlin - Dagger 2 is is not injecting objects
body: <p>I have created simple application to test Dagger 2 injection. I think I have written everything propertly but in runtime I get this error. </p>
  
  <pre><code>kotlin.UninitializedPropertyAccessException: lateinit property app has not been initialized
  </code></pre>
  
  <p>It turns out that none of my dependencies are injected.</p>
  
  <p>Here is my example:</p>
  
  <p>Component:</p>
  
  <pre><code>@Component(modules = arrayOf(AppModule::class))
  interface AppComponent {
      fun inject(app : App)
  }
  </code></pre>
  
  <p>IMainomponent:</p>
  
  <pre><code>@Component(modules = arrayOf(MainPresenterModule::class))
  interface IMainComponent {
      fun inject(mainView : MainActivity)
  }
  </code></pre>
  
  <p>AppModule:</p>
  
  <pre><code>@Module
  class AppModule(val app: App) {
      @Provides @Singleton fun provideApp() : App = app
  }
  </code></pre>
  
  <p>Main presenter module:</p>
  
  <pre><code>@Module
  class MainPresenterModule(private val view: MainActivity) {
      @Provides
      fun provideView() : MainActivity = view
  }
  </code></pre>
  
  <p>Use in activity:</p>
  
  <pre><code>class MainActivity : AppCompatActivity(), IMainView {
  
      @Inject lateinit var presenter : MainPresenter
      @Inject lateinit var app : App
  
      val component: IMainComponent by lazy {
          DaggerIMainComponent
                  .builder()
                  .mainPresenterModule(MainPresenterModule(this))
                  .build()
      }
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
          component.inject(this)
      //        presenter.beginMessuring()
  
          if(app != null) // fails here because all lateinits are null
          {
  
          }
      }
  
      override fun toastMessage(message: String) {
          Toast.makeText(this, message, Toast.LENGTH_LONG).show()
      }
  }
  </code></pre>
  
  <p>Could you tell me if I am doing something wrong.</p>
  
  <p>Gradle dagger settigns:</p>
  
  <pre><code>kapt 'com.google.dagger:dagger-compiler:2.13'
  implementation 'com.google.dagger:dagger:2.13'
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I have notieced that when I configure Dagger graph using for example this, </p>
  
  <pre><code>DaggerIMainComponent.builder().mainPresenterModule(MainPresenterModule(this)).build()
  </code></pre>
  
  <p>I get info that mainPresenterModule method is deprecated. I found info that android studio usually shows that info when it cant find any @Inject of components provided by builded module.</p>