Glide是一个用于加载图片的优秀框架,但这次却出了意外。。。加载不出图片了???
一开始本人以为是依赖可能太久了,但改了之后还是无法加载出来,这时我很大程度上就觉得是Android9.0的问题了。
最终还是和我想的一样。
解决方案
在AndroidManifest.xml加入android:usesCleartextTraffic="true"
<application
。。。
android:usesCleartextTraffic="true">
</application>
至于android:usesCleartextTraffic是什么?
图片英文如下:
Attribute usesCleartextTraffic is only used in API level 23 and higher (current min is 15) less… (Ctrl+F1)
Inspection info:This check finds attributes set in XML files that were introduced in a version newer than the oldest version targeted by your application (with the minSdkVersion attribute). This is not an error; the application will simply ignore the attribute. However, if the attribute is important to the appearance or functionality of your application, you should consider finding an alternative way to achieve the same result with only available attributes, and then you can optionally create a copy of the layout in a layout-vNN folder which will be used on API NN or higher where you can take advantage of the newer attribute. Note: This check does not only apply to attributes. For example, some tags can be unused too, such as the new element in layouts introduced in API 21. Issue id: UnusedAttribute
个人理解:
就是一个兼容低版本的属性,并非一个错误来着。( This is not an error)