androidgithubbuild.gradleandroid-glideandroid-library

how to implement glide library in build.gradle.kts


Unexpected tokens (use ';' to separate expressions on the same line)

enter image description here this is the error that i am getting while i am trying to implement Glide library in my app

I also tried to use

implementation(com.github.bumptech.glide:glide:4.16.0)

but the error still remains Can someone tell me how to implement glide library or libraries in general.


Solution

  • You are doing just a small mistake. You are using Groovy script syntax in a Kotlin Gradle file.

    Use it like this

    implementation("com.github.bumptech.glide:glide:4.16.0")
    

    Tip

    annotationProcessor("com.github.bumptech.glide:compiler:4.16.0")

    Make sure to include the annotationProcessor line for Glide's annotation processor. This is necessary if you use Glide's annotations for generating API (e.g., @GlideModule).

    kapt("com.github.bumptech.glide:compiler:4.16.0")
    

    The kapt block with correctErrorTypes = true is optional but recommended for better error handling during annotation processing.


    You can refer this link and scroll it down a little bit after that you can use how to use the library in maven, kotlin etc.

    https://mvnrepository.com/artifact/com.github.bumptech.glide/glide/4.16.0#gradle-short-kotlin