Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.6.0] error: incompatible types: GlideModule cannot be converted to Annotation @GlideModule() ^ #2865

Closed
JienLee opened this issue Feb 2, 2018 · 1 comment

Comments

@JienLee
Copy link

JienLee commented Feb 2, 2018

Glide Version: 4.6.0
Integration libraries: okhttp3-3.9.1

Update to 4.6.0, I got this issue.

Error:(10, 2) error: incompatible types: GlideModule cannot be converted to Annotation @GlideModule()  ^

My Project used exteneded 'AppGlideModule' class.

What can I do this situation?

import android.content.Context
import com.bumptech.glide.GlideBuilder
import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.load.engine.cache.ExternalCacheDiskCacheFactory
import com.bumptech.glide.load.engine.cache.LruResourceCache
import com.bumptech.glide.module.AppGlideModule

@GlideModule
class GlideModule : AppGlideModule(){
    override fun applyOptions(context: Context, builder: GlideBuilder) {
        builder.setDiskCache(ExternalCacheDiskCacheFactory(context, "cache", DISK_CACHE_SIZE))
                .setMemoryCache(LruResourceCache(cacheSize.toLong()))
    }

    override fun isManifestParsingEnabled(): Boolean {
        return false
    }

    companion object {
        private val maxMemory = (Runtime.getRuntime().maxMemory() / 1024).toInt()
        private val cacheSize = maxMemory / 8
        private val DISK_CACHE_SIZE = 1024 * 1024 * 10
    }
}
@JienLee JienLee changed the title [4.6.0] Error:(10, 2) error: incompatible types: GlideModule cannot be converted to Annotation @GlideModule() ^ [4.6.0] error: incompatible types: GlideModule cannot be converted to Annotation @GlideModule() ^ Feb 2, 2018
@sjudd
Copy link
Collaborator

sjudd commented Feb 2, 2018

Duplicate of #2863

@sjudd sjudd marked this as a duplicate of #2863 Feb 2, 2018
@sjudd sjudd closed this as completed Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants