Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make GlideApp Compatible with androidx?

I recently migrated my app from AppCompat to Androidx but now I'm facing a serious issue with GlideApp. Whenever I try building the project, it shows compilation failed.

I tried changing the following import statements,

import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;

in the build folder to:

import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;

But whenever I rebuild it just regenerates the former import statement and returns the following errors:

error: package android.support.annotation does not exist error: cannot find symbol class NonNull

like image 863
Kingsley Onwus Avatar asked Dec 10 '22 02:12

Kingsley Onwus


1 Answers

I found the fix by adding annotationProcessor 'androidx.annotation:annotation:1.1.0' to my dependencies in app build.gradle and was able to build the project with no errors.

Got the solution from here: https://github.com/bumptech/glide/issues/3080#issuecomment-426331231

like image 90
Kingsley Onwus Avatar answered Jan 19 '23 05:01

Kingsley Onwus