bumptech / bumptech/glide

@GlideModule annotated classes must implement AppGlideModule

Open
#5,328 5 comments 4 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

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
```kotlin
// 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.