1

I'm facing unresolved reference: DaggerApplicationComponent I've tried rebuild project and not worked. Every solution that I found none worked.

This is my imports

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

// Dagger 2
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.4-3"
compileOnly 'javax.annotation:jsr250-api:1.0'
implementation 'com.google.dagger:dagger-android:2.15'
implementation 'com.google.dagger:dagger-android-support:2.15'
kapt 'com.google.dagger:dagger-android-processor:2.15'
kapt 'com.google.dagger:dagger-compiler:2.15'

}
Wellington Yogui
  • 371
  • 3
  • 18
  • See this [post](https://stackoverflow.com/a/37528699/8770663) , [this](https://stackoverflow.com/a/41269256/8770663) and [this](https://stackoverflow.com/a/49605045/8770663). – Masoud Mokhtari Feb 17 '19 at 06:19

2 Answers2

0

Just replace your Dagger dependencies

 implementation 'com.google.dagger:dagger-android:2.15'
implementation 'com.google.dagger:dagger-android-support:2.15'
kapt 'com.google.dagger:dagger-android-processor:2.15'
kapt 'com.google.dagger:dagger-compiler:2.15'

With the following:

implementation  'com.google.dagger:dagger:2.15'
kapt 'com.google.dagger:dagger-compiler:2.15'

Then, build your project. It will generate your Dagger components, so they are available to import and use. If they are still unavailable, check the compiler messages. Dagger won't generate components if you make a mistake with annotations and other dagger's things.

Andrey Antipov
  • 370
  • 3
  • 9
0

click on Build->Make Project

enjoy!!

Priyanka
  • 3,369
  • 1
  • 10
  • 33