bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.67k stars 6.12k forks source link

@GlideModule annotated classes must implement AppGlideModule #5328

Open manishindiainc opened 1 year ago

manishindiainc commented 1 year ago

I have started migration of my existing Android app from kapt to ksp and getting an error

[ksp] @GlideModule annotated classes must implement AppGlideModule or LibraryGlideModule:

My Glide Module structure looks like this

// code in my app
@GlideModule
class GlideAppModule : MyGlideModule() {
    @Inject lateinit var modelLoaderFactory: GlideUrlLoaderFactory

    override fun registerComponents(context: Context, glide: Glide, registry: Registry) {
        super.registerComponents(context, glide, registry)
        // some specific registration
    }
}

// class from platform library, difficult to change
abstract class MyGlideModule : AppGlideModule() {

    override fun registerComponents(context: Context, glide: Glide,
                                    registry: Registry) {
     // registration common to platform
     }

    override fun applyOptions(context: Context, builder: GlideBuilder) {
        super.applyOptions(context, builder)
       // set disk cache
    }
}

The MyGlideModule class is from a platform library and is difficult to change. The GlideAppModule is defined in my Android library module app/impl

Now, this inheritance was working perfectly fine with kapt but with ksp, started getting this error [ksp] @GlideModule annotated classes must implement AppGlideModule or LibraryGlideModule:

Library versions used

com.github.bumptech.glide:ksp:4.16.0 // also tried with 4.14.2 and 4.15.1, same error

kotlin version: 1.9.0

Any thought would be great help.

manishindiainc commented 11 months ago

Team, could you please help with this

harshitAtlassian commented 11 months ago

Team, I'm facing this similar issue. Please provide any solution.

manishindiainc commented 11 months ago

Team, blocked on this, please provide a solution.

nirazv commented 10 months ago

i am also facing the same issue.

trietbui85 commented 7 months ago

Any update?