glide 4.9.0在Android 9.0上加載圖片不顯示解決方案

Glide 加載圖片失敗

exception: com.bumptech.glide.load.engine.GlideException: Failed to load resource ,obj: xxxxxxxxxxx.jpg target: Target for: com.hotel.widget.CustomImageView{c9c54e4 V.ED..... ........ 0,0-154,115 #7f0900d2 app:id/iv_hotel_img} boolean: true

而在9.0以下的手機可以加載。

解決辦法:在AndroidManifest.xml文件裏, application字段裏 加入 android:usesCleartextTraffic="true"

    <application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true"
        android:networkSecurityConfig="@xml/network_security_config">

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章