Androidのグライドは、Android 4.xの画像をロードしません

anehme:

私は、Webからロード画像にグライドv4.11を使用しています、アンドロイド5.0以上ですべての作業罰金が、アンドロイド4.X写真にロードされません。

ここに私のコードは次のとおりです。

 RequestOptions options = new RequestOptions()
                    .placeholder(android.R.drawable.progress_horizontal)
                    .error(android.R.drawable.presence_offline)
                    .diskCacheStrategy(DiskCacheStrategy.ALL);

   Glide.with(context)
                    .load(data.getImage_url())
                    .apply(options)
                    .into(holder.thumbnail);

そして、ここでのAndroid 4.4へのLogCatは以下のとおりです。

W/Glide: Load failed for https://cdn.myanimelist.net/images/anime/3/67177.jpg  with size [188x263]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There was 1 cause:
    javax.net.ssl.SSLHandshakeException(javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb85422a0: Failure in SSL library, usually a protocol error
    error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:766 0xa744e990:0x00000000))
     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(javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb85422a0: Failure in SSL library, usually a protocol error
    error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:766 0xa744e990:0x00000000))
     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(javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb85422a0: Failure in SSL library, usually a protocol error
    error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:766 0xa744e990:0x00000000))
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb85422a0: Failure in SSL library, usually a protocol error
    error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:766 0xa744e990:0x00000000)

私は、ウェブ上で検索し、私は、Android 4.4のみTLS 1.0をサポートすることがわかった:https://support.globalsign.com/ssl/general-ssl/tls-protocol-compatibility

それは問題になることがあり?はいあれば任意のソリューションがありますか?

ありがとうございました。

モハメドNageh:

これは、ハンドシェイク例外です。より古いデバイス上Android 5.0 TLSv1.1およびTLSv1.2プロトコルはデフォルトで有効になっており、この例外が発生した理由ですされていません。

あなたは、あなたのアプリケーションのクラスのonCreateメソッド内でこれを試すことができます。

if (Build.VERSION.SDK_INT == 19) {
        try {
            ProviderInstaller.installIfNeeded(this);
        } catch (Exception ignored) {
        }
    }

また、あなたは確認することができ、このgithubの問題をよりよく解決するために。

おすすめ

転載: http://10.200.1.11:23101/article/api/json?id=404414&siteId=1