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">