bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.59k stars 6.12k forks source link

Glide load https image with IllegalArgumentException(Could not find cipher suite) #4596

Open DysaniazzZ opened 3 years ago

DysaniazzZ commented 3 years ago

Glide Version: 4.11.0

Integration libraries: None

Device/Android Version: A TV BOX that made in china / Android 4.4.2 / API 19

Issue details / Repro steps / Use case background: When I use glide to load https image, the exception happens within onLoadFailed method. But this case only happens on Android 4.4 devices, works fine on devices that above API 19.

Glide load line / GlideModule (if any) / list Adapter code (if any):

Glide.with(imageView.context)
    .load(url)
    .addListener(object : RequestListener<Drawable> {
        override fun onLoadFailed(
            e: GlideException?,
            model: Any?,
            target: Target<Drawable>?,
            isFirstResource: Boolean
        ): Boolean {
            imageView.visibility = View.GONE
            return false
        }
        override fun onResourceReady(
            resource: Drawable?,
            model: Any?,
            target: Target<Drawable>?,
            dataSource: DataSource?,
            isFirstResource: Boolean
        ): Boolean {
            return false
        }
    })
    .into(imageView)

Stack trace / LogCat: IMG_20210720_112801

sjudd commented 3 years ago

Can you try calling GlideException#logRootCauses in onLoadFailed and paste the stack trace here?

I suspect it's an issue in the networking stack on this particular device that we're going to be unable to fix easily though :/. You might be able to use the Cronet or OkHttp integration libraries to work around the issues in the default stack: http://bumptech.github.io/glide/int/okhttp3.html