3

I have gone through various stackoverflow link some of the link are :

LInk 1

Link 2

but no one solve this below are the gradle file and my application :

    // dependency injection
implementation 'com.google.dagger:dagger-android:2.14.1'
implementation 'com.google.dagger:dagger-android-support:2.14.1'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.14.1'
annotationProcessor 'com.google.dagger:dagger-compiler:2.14.1'

And the MyApplication file is :

 DaggerAppComponent.builder()
            .application(this)
            .build()
            .inject(this);

    AppLogger.init();

enter image description here

Rakesh kushwaha
  • 709
  • 1
  • 10
  • 22

3 Answers3

3

You have to build the project after setting up dagger and then start typing Dagger and Android Studio will show the class it built for dagger component

theanilpaudel
  • 3,348
  • 8
  • 39
  • 67
2

There is many methods to solve it,

Below methods are worldwide problem solver

  1. Click on Invalidate/cache restart in android studio
  2. Close android studio, Go > androidStudio installed folder and delete cache folder manualy and start again.
  3. Rename dagger component and again clean/rebuild your project.

These 3 methods can solve your problem.

0

When I applied the plugin 'kotlin-kapt' in the gradle file, it caused the DaggerAppComponent to not be found. Disabled it and the DaggerAppComponent was found again and I am using Dagger 2.28.1.

So the issue could be linked to specific changes with the plugins.

Novjean
  • 51
  • 1
  • 5