bumptech / glide

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

Glide Not Loaded in Android 7 #4787

Open androdevsatyam opened 2 years ago

androdevsatyam commented 2 years ago

Glide Version: 4.10.0

Integration libraries: NO

Device/Android Version:

Issue details / Repro steps / Use case background:

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

Glide.with(context)
                        .load(dest_url)
                        .listener(new RequestListener<Drawable>() {
                            @Override
                            public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
                                Log.d("GreetingCArd", "onLoadFailed "+e.getCauses());
                                holder.progressBar.setVisibility(View.GONE);
                                holder.icon.setVisibility(View.GONE);
                                holder.error.setVisibility(View.VISIBLE);
                                return false;
                            }

                            @Override
                            public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
                                Log.d("GreetingCArd", "onResourceReady");
                                holder.progressBar.setVisibility(View.GONE);
                                holder.icon.setVisibility(View.VISIBLE);
                                return false;
                            }
                        })
                        .error(R.drawable.ic_image_not_found)
                        .into(holder.icon);

Layout XML:

<FrameLayout android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="@dimen/dimen_5dp"
    android:background="@drawable/edit_text_bg"
    xmlns:android="http://schemas.android.com/apk/res/android">

        <ImageView
            android:id="@+id/icon"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scaleType="fitXY"
            android:src="@drawable/error_img"
            android:contentDescription="@string/thumb"
            android:visibility="visible" />

        <ImageView
            android:id="@+id/error_imm"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:scaleType="center"
            android:contentDescription="@string/thumb"
            android:src="@drawable/error_img"
            android:visibility="gone" />

        <TextView
            android:id="@+id/title"
            style="@style/TextView.data"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:padding="7dp"
            android:textColor="#000000" />

        <ProgressBar
            android:id="@+id/progress"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:visibility="visible" />
    </FrameLayout>

Stack trace / LogCat:

Load failed for https://hpwebmart.com/software/uploads/greetings/card-622eec43bf9b2-1647242307.87.jpg with size [684x1280]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There was 1 cause:
    javax.net.ssl.SSLHandshakeException(java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.)
     call GlideException#logRootCauses(String) for more detail
      Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
    There was 1 cause:
    javax.net.ssl.SSLHandshakeException(java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.)
     call GlideException#logRootCauses(String) for more detail
        Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
    There was 1 cause:
    javax.net.ssl.SSLHandshakeException(java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.)
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
AlexUrrutia commented 7 months ago

@androdevsatyam Experiencing the same issue... Android 6.0 and 7.0 , any ideas?

implementation 'com.github.bumptech.glide:glide:4.16.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
Root cause (1 of 1)
             com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
                at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:98)
                at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
                at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
                at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:95)
                at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:88)
                at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
                at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
                at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:424)
                at java.lang.Thread.run(Thread.java:761)
                at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultPriorityThreadFactory$1.run(GlideExecutor.java:383)
             Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.