at the moment I have some trouble with Glide and android devices above 8+.
My Problem:
Inside a Adapter (RecyclerView) I want to bind a image (located on a public available server / url) with Glide. For devices lower android 8, glide works without problems and load the images into the imageview.
On devices (8+) Glide not working correctly. No images are loading into the imageview.
Inside the logcat I don´t get error messages or somethinge else.
I use the newest Android Studio and the dependencies are all up-to-date (Androidx).
My Glide Code (without custom configs):
GlideApp.with(activity)
.load(feedItem.getThumbnail())
.error(R.drawable.error)
.transition(DrawableTransitionOptions.withCrossFade(2000))
.into(feedListRowHolder.listview_thumbnail);
Gradle File:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.4'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
// implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0'
implementation 'com.squareup.okhttp3:okhttp:4.7.2'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'
// androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.core:core:1.3.0'
implementation 'com.google.android.gms:play-services-safetynet:17.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.lifecycle:lifecycle-livedata-core:2.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.google.android.material:material:1.1.0'
implementation "androidx.room:room-runtime:$rootProject.roomVersion"
annotationProcessor "androidx.room:room-compiler:$rootProject.roomVersion"
annotationProcessor "androidx.annotation:annotation:1.1.0"
androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
implementation 'androidx.navigation:navigation-fragment:2.2.2'
implementation 'androidx.navigation:navigation-ui:2.2.2'
}
I comment the okhttp integration for glide, because these library have no effect.
Can somebody help me to sole my problem? (Did you need more lines of Code?)
Edit and solution: As I mention in my last comment, after adding following two methods , glide works as aspected:
GlideApp.with(activity)
.asBitmap()
.load(feedItem.getThumbnail())
.placeholder(R.drawable.placeholder)
.error(R.drawable.error)
.transition(DrawableTransitionOptions.withCrossFade(2000))
.into(feedListRowHolder.listview_thumbnail);