Skip to content Skip to sidebar Skip to footer

Cannot Find Symbol Return Daggerapplication_hiltcomponents_singletonc.builder()

I switched to Hilt dependency injection this morning. After everything is done, then I stuck with this one: error: cannot find symbol return DaggerMyApplication_HiltComponents_Sin

Solution 1:

In my case this error caused by androidx.hilt:hilt-lifecycle-viewmodel dependency

According to Dagger Hilt Github comments:

implementation "androidx.hilt:hilt-lifecycle-viewmodel"
kapt "androidx.hilt:hilt-compiler"

should be removed.

see this, also this

Solution 2:

I eventually find out the problem. It was because I used @GlideModule wrongly:

@GlideModule
class Glide4Engine @Inject constructor(
   private val context:Context
): AppGlideModule() {
}

So, I have to do it another way like this:

@GlideModuleclassGlide4Engine : AppGlideModule() {
    // Empty
}

And create other class:

classMyGlide@Injectconstructor(
    privateval context: Context
) {
  //// Things
}

Hoping it can help if you are facing a problem like that ;)

Post a Comment for "Cannot Find Symbol Return Daggerapplication_hiltcomponents_singletonc.builder()"